From f3a4fb070131409c30c4d5ae96513d2c26e5455a Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Fri, 1 Jan 2010 15:17:41 +0000 Subject: [PATCH] * connect to db auto if the config file is saved. --- www/install.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/www/install.php b/www/install.php index 285d5ab3b9..fd6623b3d2 100644 --- a/www/install.php +++ b/www/install.php @@ -24,6 +24,8 @@ * @link http://www.zentao.cn */ error_reporting(E_ALL); +session_start(); +define('IN_INSTALL', true); /* 包含必须的类文件。*/ include '../../../framework/router.class.php'; @@ -37,13 +39,16 @@ $app = router::createApp('pms', '', 'myRouter'); $config = $app->loadConfig('common'); /* 检查是否已经安装过。*/ -if(isset($config->installed) and $config->installed) die(header('location: index.php')); +if(!isset($_SESSION['installing']) and isset($config->installed) and $config->installed) die(header('location: index.php')); /* 重新设置config参数,进行安装。*/ $config->set('requestType', 'GET'); $config->set('debug', true); $config->set('default.module', 'install'); +/* 如果已经保存配置文件,则自动连接到数据库。*/ +if(isset($config->installed) and $config->installed) $dbh = $app->connectDB(); + /* 设置客户端所使用的语言、风格。*/ $app->setClientLang(); $app->setClientTheme();