+ add the feature of just installed or not.

This commit is contained in:
wangchunsheng
2009-12-31 09:57:41 +00:00
parent 1b5bd34a53
commit 95e86e369e
2 changed files with 14 additions and 1 deletions
+6 -1
View File
@@ -36,7 +36,12 @@ include './myrouter.class.php';
/* 实例化路由对象,加载配置,连接到数据库。*/
$app = router::createApp('pms', '', 'myRouter');
$config = $app->loadConfig('common');
$dbh = $app->connectDB();
/* 检查是否已经安装。*/
if(!isset($config->installed) or !$config->installed) die(header('location: install.php'));
/* 连接到数据库。*/
$dbh = $app->connectDB();
/* 根据debug选项设置错误信息。*/
$config->debug ? error_reporting(E_ALL) : error_reporting(0);
+8
View File
@@ -23,6 +23,8 @@
* @version $Id$
* @link http://www.zentao.cn
*/
error_reporting(E_ALL);
/* 包含必须的类文件。*/
include '../../../framework/router.class.php';
include '../../../framework/control.class.php';
@@ -33,7 +35,13 @@ include './myrouter.class.php';
/* 实例化路由对象,加载配置,连接到数据库。*/
$app = router::createApp('pms', '', 'myRouter');
$config = $app->loadConfig('common');
/* 检查是否已经安装过。*/
if(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');
/* 设置客户端所使用的语言、风格。*/