* upgrade the version.

This commit is contained in:
wangchunsheng
2010-03-10 12:55:35 +00:00
parent 54b117508e
commit 2422a4989d
4 changed files with 23 additions and 23 deletions

View File

@@ -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>

View File

@@ -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()
{

View File

@@ -23,7 +23,7 @@
*/
class install extends control
{
const VERSION = '0.5 beta';
const VERSION = '0.6 beta';
/* 构造函数,检查是否是通过安装入口调用。*/
public function __construct()

View File

@@ -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)
{