* Change save zentaoclient dir.

This commit is contained in:
Yagami
2019-05-08 10:38:35 +08:00
parent f2b2e99e6c
commit 8203570b89
4 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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))
+1 -1
View File
@@ -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. */
+8 -8
View File
@@ -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);