* code for task #2464.

This commit is contained in:
wangyidong
2016-02-19 14:35:03 +08:00
parent aa6f3bc46d
commit bbf3d672af
9 changed files with 68 additions and 98 deletions
+4 -4
View File
@@ -159,7 +159,7 @@ class installModel extends model
*/
public function getDataRoot()
{
$result['path'] = $this->app->getAppRoot() . 'www' . $this->app->getPathFix() . 'data';
$result['path'] = $this->app->getAppRoot() . 'www' . DS . 'data';
$result['exists'] = is_dir($result['path']);
$result['writable']= is_writable($result['path']);
return $result;
@@ -173,7 +173,7 @@ class installModel extends model
*/
public function checkDataRoot()
{
$dataRoot = $this->app->getAppRoot() . 'www' . $this->app->getPathFix() . 'data';
$dataRoot = $this->app->getAppRoot() . 'www' . DS . 'data';
return $result = (is_dir($dataRoot) and is_writable($dataRoot)) ? 'ok' : 'fail';
}
@@ -354,7 +354,7 @@ class installModel extends model
*/
public function createTable($version)
{
$dbFile = $this->app->getAppRoot() . 'db' . $this->app->getPathFix() . 'zentao.sql';
$dbFile = $this->app->getAppRoot() . 'db' . DS . 'zentao.sql';
$tables = explode(';', file_get_contents($dbFile));
foreach($tables as $table)
{
@@ -425,7 +425,7 @@ class installModel extends model
*/
public function importDemoData()
{
$demoDataFile = $this->app->getAppRoot() . 'db' . $this->app->getPathFix() . 'demo.sql';
$demoDataFile = $this->app->getAppRoot() . 'db' . DS . 'demo.sql';
$insertTables = explode(";\n", file_get_contents($demoDataFile));
foreach($insertTables as $table)
{