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'; }