diff --git a/module/install/model.php b/module/install/model.php index 7ecc152b44..db20fbbbd0 100644 --- a/module/install/model.php +++ b/module/install/model.php @@ -123,9 +123,8 @@ class installModel extends model { $this->dbh->useDB($this->config->db->name); - $dbCharset = $this->dbh->getDatabaseCharsetAndCollation($this->config->db->name); - $dbFile = $this->app->getAppRoot() . 'db' . DS . 'zentao.sql'; - $tables = explode(';', file_get_contents($dbFile)); + $dbFile = $this->app->getAppRoot() . 'db' . DS . 'zentao.sql'; + $tables = explode(';', file_get_contents($dbFile)); foreach($tables as $table) { diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 9ef1376d53..86d24695a6 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -16,15 +16,6 @@ class upgradeModel extends model { static $errors = array(); - /** - * 数据库版本。 - * Database version. - * - * @var string - * access public - */ - public $databaseVersion = ''; - public $fromVersion = ''; public $fromEdition = ''; @@ -40,7 +31,6 @@ class upgradeModel extends model { parent::__construct(); $this->loadModel('setting'); - $this->databaseVersion = $this->loadModel('install')->getDatabaseVersion(); } /** @@ -10854,7 +10844,8 @@ class upgradeModel extends model { if($this->config->db->driver != 'mysql') return true; - if(version_compare($this->databaseVersion, '5.6', '<')) return true; + $dbVersion = $this->loadModel('install')->getDatabaseVersion(); + if(version_compare($dbVersion, '5.6', '<')) return true; /* 获取服务器的字符集和排序规则。Get server charset and collation. */ $result = $this->dbh->getServerCharsetAndCollation($this->config->db->name);