From 4e114754d3bfc026da8bde6894a20fdf47aed908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 17 Apr 2023 15:49:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GiiController.php | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/GiiController.php b/GiiController.php index e42d96c..79616f0 100644 --- a/GiiController.php +++ b/GiiController.php @@ -58,14 +58,14 @@ namespace {$namespace}; "; if (file_exists($path['path'] . '/' . $managerName . 'Controller.php')) { -// try { -// $class = new \ReflectionClass($controller); -// -// $import = $this->getImports($path['path'] . '/' . $managerName . 'Controller.php', $class); -// } catch (\Throwable $Exception) { -// logger()->addError($Exception, 'throwable'); -// exit(); -// } + try { + $class = new \ReflectionClass($controller); + + $import = $this->getImports($path['path'] . '/' . $managerName . 'Controller.php', $class); + } catch (\Throwable $Exception) { + logger()->addError($Exception, 'throwable'); + exit(); + } } else { $import = "use Kiri; use Exception; @@ -129,13 +129,13 @@ use Psr\Http\Message\ResponseInterface; $file = APP_PATH . 'routes/' . $this->input->getOption('database') . '.php'; if (!file_exists($file)) { -// touch($file); -// file_put_contents($file, 'db->tablePrefix, '', $this->tableName); @@ -153,15 +153,15 @@ use Psr\Http\Message\ResponseInterface; }); '; if (!str_contains($this->clearBlank(file_get_contents($file)), $this->clearBlank($addRouter))) { -// file_put_contents($file, $addRouter, FILE_APPEND); + file_put_contents($file, $addRouter, FILE_APPEND); } $file = $path['path'] . '/' . $controllerName . 'Controller.php'; if (file_exists($file)) { -// unlink($file); + unlink($file); } -// Kiri::writeFile($file, $html); + Kiri::writeFile($file, $html); return $controllerName . 'Controller.php'; }