* upgrade the version.
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>趨<EFBFBD><E8B6A8>*/
|
||||
$config->version = '0.5 beta'; // <20>汾<EFBFBD>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ġ<DEB8>
|
||||
$config->version = '0.6 beta'; // <20>汾<EFBFBD>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ġ<DEB8>
|
||||
$config->helpRoot = 'http://doc.zentao.cn/help/'; // <20><><EFBFBD>߰<EFBFBD><DFB0><EFBFBD><EFBFBD><EFBFBD>URI<52><49>ַ<EFBFBD><D6B7>
|
||||
$config->encoding = 'UTF-8'; // <20><>վ<EFBFBD>ı<EFBFBD><C4B1>롣
|
||||
$config->cookiePath = '/'; // cookie<69><65><EFBFBD><EFBFBD>Ч·<D0A7><C2B7><EFBFBD><EFBFBD>
|
||||
|
||||
@@ -61,7 +61,7 @@ class bugfreeConvertModel extends convertModel
|
||||
$result['bugs'] = $this->convertBug();
|
||||
$result['actions'] = $this->convertAction();
|
||||
$result['files'] = $this->convertFile();
|
||||
$this->fixModulePath();
|
||||
$this->loadModel('tree')->fixModulePath();
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -155,26 +155,6 @@ class bugfreeConvertModel extends convertModel
|
||||
return count($modules);
|
||||
}
|
||||
|
||||
/* <20><EFBFBD>ģ<EFBFBD><C4A3>·<EFBFBD><C2B7><EFBFBD><EFBFBD>*/
|
||||
public function fixModulePath()
|
||||
{
|
||||
$modules = $this->dao->dbh($this->dbh)->select('*')->from(TABLE_MODULE)->where('view')->eq('bug')->fetchAll('id');
|
||||
foreach($modules as $moduleID => $module)
|
||||
{
|
||||
if($module->grade == 1)
|
||||
{
|
||||
$path = ",$moduleID,";
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!isset($modules[$module->parent])) continue;
|
||||
$parentModule = $modules[$module->parent];
|
||||
$path = $parentModule->path . $moduleID . ',';
|
||||
}
|
||||
$this->dao->update(TABLE_MODULE)->set('path')->eq($path)->where('id')->eq($moduleID)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
/* ת<><D7AA>Bug<75><67>*/
|
||||
public function convertBug()
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
class install extends control
|
||||
{
|
||||
const VERSION = '0.5 beta';
|
||||
const VERSION = '0.6 beta';
|
||||
|
||||
/* 构造函数,检查是否是通过安装入口调用。*/
|
||||
public function __construct()
|
||||
|
||||
@@ -34,10 +34,16 @@ class upgradeModel extends model
|
||||
{
|
||||
$this->upgradeFrom0_3To0_4();
|
||||
$this->upgradeFrom0_4To0_5();
|
||||
$this->upgradeFrom0_5To0_6();
|
||||
}
|
||||
elseif($fromVersion == '0_4')
|
||||
{
|
||||
$this->upgradeFrom0_4To0_5();
|
||||
$this->upgradeFrom0_5To0_6();
|
||||
}
|
||||
elseif($fromVersion == '0_5')
|
||||
{
|
||||
$this->upgradeFrom0_5To0_6();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,11 +55,18 @@ class upgradeModel extends model
|
||||
{
|
||||
$confirmContent .= file_get_contents($this->getUpgradeFile('0.3'));
|
||||
$confirmContent .= file_get_contents($this->getUpgradeFile('0.4'));
|
||||
$confirmContent .= file_get_contents($this->getUpgradeFile('0.5'));
|
||||
}
|
||||
elseif($fromVersion == '0_4')
|
||||
{
|
||||
$confirmContent .= file_get_contents($this->getUpgradeFile('0.4'));
|
||||
$confirmContent .= file_get_contents($this->getUpgradeFile('0.5'));
|
||||
}
|
||||
elseif($fromVersion == '0_5')
|
||||
{
|
||||
$confirmContent .= file_get_contents($this->getUpgradeFile('0.5'));
|
||||
}
|
||||
|
||||
return str_replace('zt_', $this->config->db->prefix, $confirmContent);
|
||||
}
|
||||
|
||||
@@ -72,6 +85,13 @@ class upgradeModel extends model
|
||||
if(!$this->isError()) $this->updateVersion('0.5 beta');
|
||||
}
|
||||
|
||||
/* 从0.5版本升级到0.6版本。*/
|
||||
private function upgradeFrom0_5To0_6()
|
||||
{
|
||||
$this->execSQL($this->getUpgradeFile('0.5'));
|
||||
if(!$this->isError()) $this->updateVersion('0.6 beta');
|
||||
}
|
||||
|
||||
/* 更新PMS的版本设置。*/
|
||||
public function updateVersion($version)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user