parent
cca27a77d6
commit
969299b495
|
|
@ -78,7 +78,7 @@ return array(
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'key' => 'Rocktober!!!',
|
'key' => 'CHANGE_ME!!!',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,17 @@ return array(
|
||||||
|
|
||||||
'uploadsDir' => '/uploads',
|
'uploadsDir' => '/uploads',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Uploads directory
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Specifies the uploads directory relative to the application root directory.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'tempDir' => storage_path().'/temp',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Default permission mask
|
| Default permission mask
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
<?php namespace System\Classes;
|
<?php namespace System\Classes;
|
||||||
|
|
||||||
use App;
|
use App;
|
||||||
use Log;
|
|
||||||
use URL;
|
use URL;
|
||||||
|
use File;
|
||||||
use Lang;
|
use Lang;
|
||||||
use Http;
|
use Http;
|
||||||
use Schema;
|
use Schema;
|
||||||
|
|
@ -72,8 +72,14 @@ class UpdateManager
|
||||||
$this->versionManager = VersionManager::instance();
|
$this->versionManager = VersionManager::instance();
|
||||||
$this->migrator = App::make('migrator');
|
$this->migrator = App::make('migrator');
|
||||||
$this->repository = App::make('migration.repository');
|
$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;
|
$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 = [])
|
public function requestServerData($uri, $postData = [])
|
||||||
{
|
{
|
||||||
try {
|
$result = Http::post($this->createServerUrl($uri), function($http) use ($postData) {
|
||||||
$result = Http::post($this->createServerUrl($uri), function($http) use ($postData) {
|
$this->applyHttpAttributes($http, $postData);
|
||||||
$this->applyHttpAttributes($http, $postData);
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
catch (Exception $ex) {
|
|
||||||
Log::error($ex);
|
|
||||||
throw new ApplicationException(Lang::get('system::lang.server.connect_error'));
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($result->code == 404)
|
if ($result->code == 404)
|
||||||
throw new ApplicationException(Lang::get('system::lang.server.response_not_found'));
|
throw new ApplicationException(Lang::get('system::lang.server.response_not_found'));
|
||||||
|
|
@ -516,16 +516,10 @@ class UpdateManager
|
||||||
{
|
{
|
||||||
$filePath = $this->getFilePath($fileCode);
|
$filePath = $this->getFilePath($fileCode);
|
||||||
|
|
||||||
try {
|
$result = Http::post($this->createServerUrl($uri), function($http) use ($postData, $filePath) {
|
||||||
$result = Http::post($this->createServerUrl($uri), function($http) use ($postData, $filePath) {
|
$this->applyHttpAttributes($http, $postData);
|
||||||
$this->applyHttpAttributes($http, $postData);
|
$http->toFile($filePath);
|
||||||
$http->toFile($filePath);
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
catch (Exception $ex) {
|
|
||||||
Log::error($ex);
|
|
||||||
throw new ApplicationException(Lang::get('system::lang.server.connect_error'));
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($result->code != 200)
|
if ($result->code != 200)
|
||||||
throw new ApplicationException(Lang::get('system::lang.server.file_error'));
|
throw new ApplicationException(Lang::get('system::lang.server.file_error'));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue