From 8203570b891baeaa4f590c0bde16af022788116a Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Wed, 8 May 2019 10:38:35 +0800 Subject: [PATCH] * Change save zentaoclient dir. --- .../misc/ext/control/ajaxgetclientpackage.php | 2 +- .../misc/ext/control/ajaxgetpackagesize.php | 2 +- .../misc/ext/control/ajaxsetclientconfig.php | 2 +- .../module/misc/ext/control/downloadclient.php | 16 ++++++++-------- 4 files changed, 11 insertions(+), 11 deletions(-) mode change 100644 => 100755 xuanxuan/module/misc/ext/control/ajaxgetclientpackage.php mode change 100644 => 100755 xuanxuan/module/misc/ext/control/ajaxgetpackagesize.php mode change 100644 => 100755 xuanxuan/module/misc/ext/control/ajaxsetclientconfig.php mode change 100644 => 100755 xuanxuan/module/misc/ext/control/downloadclient.php diff --git a/xuanxuan/module/misc/ext/control/ajaxgetclientpackage.php b/xuanxuan/module/misc/ext/control/ajaxgetclientpackage.php old mode 100644 new mode 100755 index da2575d528..0de93c3e18 --- a/xuanxuan/module/misc/ext/control/ajaxgetclientpackage.php +++ b/xuanxuan/module/misc/ext/control/ajaxgetclientpackage.php @@ -18,7 +18,7 @@ class myMisc extends misc $response['result'] = 'success'; $response['message'] = ''; - $clientDir = $this->app->getBasePath() . 'tmp/cache/client/'; + $clientDir = $this->app->wwwRoot . 'data/client/'; if(!is_dir($clientDir)) mkdir($clientDir, 0755, true); $version = $this->config->xuanxuan->version; diff --git a/xuanxuan/module/misc/ext/control/ajaxgetpackagesize.php b/xuanxuan/module/misc/ext/control/ajaxgetpackagesize.php old mode 100644 new mode 100755 index 73ca2655f9..83627f9288 --- a/xuanxuan/module/misc/ext/control/ajaxgetpackagesize.php +++ b/xuanxuan/module/misc/ext/control/ajaxgetpackagesize.php @@ -11,7 +11,7 @@ class myMisc extends misc public function ajaxGetPackageSize() { $account = $this->app->user->account; - $packageFile = $this->app->getBasePath() . 'tmp/cache/client/' . $account . '/zentaoclient.zip'; + $packageFile = $this->app->wwwRoot . 'data/client/' . $account . '/zentaoclient.zip'; $size = 0; if(file_exists($packageFile)) diff --git a/xuanxuan/module/misc/ext/control/ajaxsetclientconfig.php b/xuanxuan/module/misc/ext/control/ajaxsetclientconfig.php old mode 100644 new mode 100755 index ac956fc495..96909d81f0 --- a/xuanxuan/module/misc/ext/control/ajaxsetclientconfig.php +++ b/xuanxuan/module/misc/ext/control/ajaxsetclientconfig.php @@ -14,7 +14,7 @@ class myMisc extends misc $response['result'] = 'success'; $account = $this->app->user->account; - $clientDir = $this->app->getBasePath() . 'tmp/cache/client/' . "$account/"; + $clientDir = $this->app->wwwRoot . 'data/client/' . "$account/"; if(!is_dir($clientDir)) mkdir($clientDir, 0755, true); /* write login info into config file. */ diff --git a/xuanxuan/module/misc/ext/control/downloadclient.php b/xuanxuan/module/misc/ext/control/downloadclient.php old mode 100644 new mode 100755 index 1a3261b497..dc26034c18 --- a/xuanxuan/module/misc/ext/control/downloadclient.php +++ b/xuanxuan/module/misc/ext/control/downloadclient.php @@ -24,21 +24,21 @@ class myMisc extends misc $error = false; $errorInfo = ''; - $cacheDir = $this->app->getBasePath() . 'tmp/cache/'; - if(!is_dir($cacheDir)) + $clientDir = $this->app->wwwRoot . 'data/client/' . $this->config->xuanxuan->version . '/'; + if(!is_dir($clientDir)) { - $result = mkdir($cacheDir, 0755, true); + $result = mkdir($clientDir, 0755, true); if($result == false) { $error = true; - $errorInfo = sprintf($this->lang->misc->client->errorInfo->dirNotExist, $cacheDir, $cacheDir); + $errorInfo = sprintf($this->lang->misc->client->errorInfo->dirNotExist, $clientDir, $clientDir); } } - if(!is_writable($cacheDir)) + if(!is_writable($clientDir)) { $error = true; - $errorInfo = sprintf($this->lang->misc->client->errorInfo->dirNotWritable, $cacheDir, $cacheDir); + $errorInfo = sprintf($this->lang->misc->client->errorInfo->dirNotWritable, $clientDir, $clientDir); } $this->view->error = $error; @@ -67,7 +67,7 @@ class myMisc extends misc if($action == 'clearTmpPackage') { $account = $this->app->user->account; - $tmpDir = $this->app->getBasePath() . 'tmp/cache/client/' . "$account/"; + $tmpDir = $this->app->wwwRoot . 'data/client/' . "$account/"; if(is_dir($tmpDir)) { @@ -81,7 +81,7 @@ class myMisc extends misc if($action == 'downloadPackage') { $account = $this->app->user->account; - $clientDir = $this->app->getBasePath() . 'tmp/cache/client/' . "$account/"; + $clientDir = $this->app->wwwRoot . 'data/client/' . "$account/"; $clientFile = $clientDir . 'zentaoclient.zip'; $zipContent = file_get_contents($clientFile);