Files
EasySoft-ZenTaoPMS/www/upgrade.php
chencongzhi520@gmail.com e86ff7b0b4 * adjust code for task#778.
2012-05-01 04:16:06 +00:00

46 lines
1.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* The upgrade router file of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 QingDao Nature Easy Soft Network Technology Co,LTD (www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package ZenTaoPMS
* @version $Id$
* @link http://www.zentao.net
*/
$myConfig = dirname(dirname(__FILE__)) . '/config/my.php';
if(!file_exists($myConfig))
{
echo "文件" . $myConfig . "不存在! 提示不要重命名zentao再覆盖" . "<br />";
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__)));
$common = $app->loadCommon();
/* Reset the config params to make sure the install program will be lauched. */
$config->set('requestType', 'GET');
$config->set('debug', true);
$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();