Selfupgrade CLI: Fixed broken selfupgrade assets reference (fixes #2681)

This commit is contained in:
Djamil Legato
2019-10-10 12:25:28 -07:00
parent 411871f636
commit b4fa7e38b9
3 changed files with 7 additions and 5 deletions

View File

@@ -15,6 +15,7 @@
* Fixed fatal error if there are numeric folders in `Flex Pages`
* Fixed error on missing `Flex` templates in if `Flex Objects` plugin isn't installed
* Grav 1.7: Fixed PHP 7.1 compatibility issues
* Selfupgrade CLI: Fixed broken selfupgrade assets reference [#2681](https://github.com/getgrav/grav/issues/2681)
# v1.7.0-beta.10
## 10/03/2019

View File

@@ -135,7 +135,8 @@ class Response
if (!$settings['verify_peer']) {
$overrides = array_replace_recursive([], $overrides, [
'curl' => [
CURLOPT_SSL_VERIFYPEER => $settings['verify_peer']
CURLOPT_SSL_VERIFYPEER => $settings['verify_peer'],
CURLOPT_SSL_VERIFYHOST => false
],
'fopen' => [
'ssl' => [

View File

@@ -185,17 +185,17 @@ class SelfupgradeCommand extends ConsoleCommand
{
$tmp_dir = Grav::instance()['locator']->findResource('tmp://', true, true);
$this->tmp = $tmp_dir . '/Grav-' . uniqid('', false);
$output = Response::get($package->download, [], [$this, 'progress']);
$output = Response::get($package['download'], [], [$this, 'progress']);
Folder::create($this->tmp);
$this->output->write("\x0D");
$this->output->write(" |- Downloading upgrade [{$this->formatBytes($package->size)}]... 100%");
$this->output->write(" |- Downloading upgrade [{$this->formatBytes($package['size'])}]... 100%");
$this->output->writeln('');
file_put_contents($this->tmp . DS . $package->name, $output);
file_put_contents($this->tmp . DS . $package['name'], $output);
return $this->tmp . DS . $package->name;
return $this->tmp . DS . $package['name'];
}
/**