* change the upgrade module.

This commit is contained in:
wangchunsheng
2010-03-31 06:31:42 +00:00
parent a834b4e0bb
commit dcafafe76c
4 changed files with 24 additions and 2 deletions

View File

@@ -22,7 +22,7 @@
* @link http://www.zentao.cn
*/
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8B6A8>*/
$config->version = '1.0 beta'; // <20><EFBFBD>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ġ<DEB8>
$config->version = '1.0beta'; // <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

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

View File

@@ -46,3 +46,4 @@ $lang->upgrade->sureExecute = '确认执行';
$lang->upgrade->fromVersions['0_3'] = '0.3 BETA';
$lang->upgrade->fromVersions['0_4'] = '0.4 BETA';
$lang->upgrade->fromVersions['0_5'] = '0.5 BETA';
$lang->upgrade->fromVersions['0_6'] = '0.6 BETA';

View File

@@ -35,15 +35,22 @@ class upgradeModel extends model
$this->upgradeFrom0_3To0_4();
$this->upgradeFrom0_4To0_5();
$this->upgradeFrom0_5To0_6();
$this->upgradeFrom0_6To1_0_B();
}
elseif($fromVersion == '0_4')
{
$this->upgradeFrom0_4To0_5();
$this->upgradeFrom0_5To0_6();
$this->upgradeFrom0_6To1_0_B();
}
elseif($fromVersion == '0_5')
{
$this->upgradeFrom0_5To0_6();
$this->upgradeFrom0_6To1_0_B();
}
elseif($fromVersion == '0_6')
{
$this->upgradeFrom0_6To1_0_B();
}
}
@@ -56,15 +63,22 @@ 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'));
$confirmContent .= file_get_contents($this->getUpgradeFile('0.6'));
}
elseif($fromVersion == '0_4')
{
$confirmContent .= file_get_contents($this->getUpgradeFile('0.4'));
$confirmContent .= file_get_contents($this->getUpgradeFile('0.5'));
$confirmContent .= file_get_contents($this->getUpgradeFile('0.6'));
}
elseif($fromVersion == '0_5')
{
$confirmContent .= file_get_contents($this->getUpgradeFile('0.5'));
$confirmContent .= file_get_contents($this->getUpgradeFile('0.6'));
}
elseif($fromVersion == '0_6')
{
$confirmContent .= file_get_contents($this->getUpgradeFile('0.6'));
}
return str_replace('zt_', $this->config->db->prefix, $confirmContent);
@@ -92,6 +106,13 @@ class upgradeModel extends model
if(!$this->isError()) $this->updateVersion('0.6 beta');
}
/* 从0.6版本升级到1.0 beta版本。*/
private function upgradeFrom0_6To1_0_B()
{
$this->execSQL($this->getUpgradeFile('0.6'));
if(!$this->isError()) $this->updateVersion('1.0beta');
}
/* 更新PMS的版本设置。*/
public function updateVersion($version)
{