diff --git a/app/config/app.php b/app/config/app.php index 9ff880629..c4f24afe1 100644 --- a/app/config/app.php +++ b/app/config/app.php @@ -78,7 +78,7 @@ return array( | */ - 'key' => 'Rocktober!!!', + 'key' => 'CHANGE_ME!!!', /* |-------------------------------------------------------------------------- diff --git a/app/config/cms.php b/app/config/cms.php index f460eb22e..fb7fec73c 100644 --- a/app/config/cms.php +++ b/app/config/cms.php @@ -158,6 +158,17 @@ return array( 'uploadsDir' => '/uploads', + /* + |-------------------------------------------------------------------------- + | Uploads directory + |-------------------------------------------------------------------------- + | + | Specifies the uploads directory relative to the application root directory. + | + */ + + 'tempDir' => storage_path().'/temp', + /* |-------------------------------------------------------------------------- | Default permission mask diff --git a/modules/system/classes/UpdateManager.php b/modules/system/classes/UpdateManager.php index 0cbdd5122..3b86ad94f 100644 --- a/modules/system/classes/UpdateManager.php +++ b/modules/system/classes/UpdateManager.php @@ -1,8 +1,8 @@ versionManager = VersionManager::instance(); $this->migrator = App::make('migrator'); $this->repository = App::make('migration.repository'); - $this->tempDirectory = sys_get_temp_dir(); + $this->tempDirectory = Config::get('cms.tempDir', sys_get_temp_dir()); $this->baseDirectory = PATH_BASE; + + /* + * Ensure temp directory exists + */ + if (!File::isDirectory($this->tempDirectory)) + File::makeDirectory($this->tempDirectory, 0777, true); } /** @@ -468,15 +474,9 @@ class UpdateManager */ public function requestServerData($uri, $postData = []) { - try { - $result = Http::post($this->createServerUrl($uri), function($http) use ($postData) { - $this->applyHttpAttributes($http, $postData); - }); - } - catch (Exception $ex) { - Log::error($ex); - throw new ApplicationException(Lang::get('system::lang.server.connect_error')); - } + $result = Http::post($this->createServerUrl($uri), function($http) use ($postData) { + $this->applyHttpAttributes($http, $postData); + }); if ($result->code == 404) throw new ApplicationException(Lang::get('system::lang.server.response_not_found')); @@ -516,16 +516,10 @@ class UpdateManager { $filePath = $this->getFilePath($fileCode); - try { - $result = Http::post($this->createServerUrl($uri), function($http) use ($postData, $filePath) { - $this->applyHttpAttributes($http, $postData); - $http->toFile($filePath); - }); - } - catch (Exception $ex) { - Log::error($ex); - throw new ApplicationException(Lang::get('system::lang.server.connect_error')); - } + $result = Http::post($this->createServerUrl($uri), function($http) use ($postData, $filePath) { + $this->applyHttpAttributes($http, $postData); + $http->toFile($filePath); + }); if ($result->code != 200) throw new ApplicationException(Lang::get('system::lang.server.file_error'));