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

@@ -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'];
}
/**