From 95780d863e1d6ad175bfd8e7f85e9c1cc737ebe2 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 2 Dec 2016 09:12:59 +0800 Subject: [PATCH] + add upgrade and install tmp file. --- www/install.php.tmp | 37 ++++++++++++++++++++++++++++++++++++ www/upgrade.php.tmp | 46 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 www/install.php.tmp create mode 100644 www/upgrade.php.tmp diff --git a/www/install.php.tmp b/www/install.php.tmp new file mode 100644 index 0000000000..04596f2d31 --- /dev/null +++ b/www/install.php.tmp @@ -0,0 +1,37 @@ + + * @package ZenTaoPMS + * @version $Id: install.php 4677 2013-04-26 06:23:58Z chencongzhi520@gmail.com $ + * @link http://www.zentao.net + */ +error_reporting(0); +session_start(); +define('IN_INSTALL', true); + +/* Load the framework. */ +include '../framework/router.class.php'; +include '../framework/control.class.php'; +include '../framework/model.class.php'; +include '../framework/helper.class.php'; + +/* Instance the app. */ +$app = router::createApp('pms', dirname(dirname(__FILE__)), 'router'); + +/* Check installed or not. */ +if(!isset($_SESSION['installing']) and isset($config->installed) and $config->installed) die(header('location: index.php')); + +/* Reset the config params to make sure the install program will be lauched. */ +$config->set('requestType', 'GET'); +$config->set('default.module', 'install'); +$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(); diff --git a/www/upgrade.php.tmp b/www/upgrade.php.tmp new file mode 100644 index 0000000000..b9060a929a --- /dev/null +++ b/www/upgrade.php.tmp @@ -0,0 +1,46 @@ + + * @package ZenTaoPMS + * @version $Id: upgrade.php 4677 2013-04-26 06:23:58Z chencongzhi520@gmail.com $ + * @link http://www.zentao.net + */ +/* Judge my.php exists or not. */ +define('IN_UPGRADE', true); +$myConfig = dirname(dirname(__FILE__)) . '/config/my.php'; +if(!file_exists($myConfig)) +{ + echo "文件" . $myConfig . "不存在! 提示:不要重命名原来的禅道安装目录,下载最新的源码包,覆盖即可。" . "
"; + echo $myConfig . " doesn't exists! Please don't rename zentao before overriding the source code!"; + exit; +} + +error_reporting(0); + +/* Load the framework. */ +include '../framework/router.class.php'; +include '../framework/control.class.php'; +include '../framework/model.class.php'; +include '../framework/helper.class.php'; + +/* Instance the app. */ +$app = router::createApp('pms', dirname(dirname(__FILE__)), 'router'); +$common = $app->loadCommon(); + +/* Reset the config params to make sure the install program will be lauched. */ +$config->set('requestType', 'GET'); +$config->set('default.module', 'upgrade'); +$app->setDebug(); + +/* Check the installed version is the latest or not. */ +$config->installedVersion = $common->loadModel('setting')->getVersion(); +if(version_compare($config->version, $config->installedVersion) <= 0) die(header('location: index.php')); + +/* Run it. */ +$app->parseRequest(); +$common->checkUpgradeStatus(); +$app->loadModule();