From bd8672eb14b2c9ed45470a8d13a5d5036db24594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E9=87=91=E5=8B=87?= Date: Wed, 11 Oct 2023 06:59:50 +0000 Subject: [PATCH] * Fix bugs of install. --- framework/base/control.class.php | 2 +- framework/base/router.class.php | 4 ++-- www/install.php.tmp | 11 +++++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/framework/base/control.class.php b/framework/base/control.class.php index 632c355b1c..e851e4e5f1 100644 --- a/framework/base/control.class.php +++ b/framework/base/control.class.php @@ -1017,7 +1017,7 @@ class baseControl \zin\zin::$data = (array)$this->view; \zin\zin::$data['zinDebug'] = array(); - if($this->config->debug && $this->config->debug >= 2) + if($this->config->debug && $this->config->debug >= 2 && $this->config->installed) { \zin\zin::$data['zinDebug']['trace'] = $this->app->loadClass('trace')->getTrace(); } diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 72b16fa67c..3905c9a736 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -778,7 +778,7 @@ class baseRouter */ protected function setupProfiling(): void { - if(!empty($this->config->debug) && $this->config->debug >= 3) $this->dbh->exec('SET profiling = 1'); + if(!empty($this->config->debug) && $this->config->debug >= 3 && $this->config->installed) $this->dbh->exec('SET profiling = 1'); } /** @@ -2401,7 +2401,7 @@ class baseRouter } /* 调用该方法 Call the method. */ - $module = $this->control ? $this->control : $this->config->default->module; + $module = $this->control; $method = $this->methodName ? $this->methodName : $this->config->default->method; call_user_func_array(array($module, $method), $this->params); diff --git a/www/install.php.tmp b/www/install.php.tmp index f3d9255379..f71f3cb57f 100644 --- a/www/install.php.tmp +++ b/www/install.php.tmp @@ -32,5 +32,12 @@ $app->setDebug(); /* During the installation, if the database params is setted, auto connect the db. */ if(isset($config->installed) and $config->installed) $app->connectDB(); -$app->parseRequest(); -$app->loadModule(); +try +{ + $app->parseRequest(); + $app->loadModule(); +} +catch (EndResponseException $endResponseException) +{ + echo $endResponseException->getContent(); +}