From b3a9d7cd4117ff6aa10f7302edbc7a4c8df95102 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Wed, 8 Apr 2015 22:29:50 -0600 Subject: [PATCH] fixes for broken gpm selfupgrade --- system/src/Grav/Common/GPM/Remote/Grav.php | 6 +++--- system/src/Grav/Console/Gpm/SelfupgradeCommand.php | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/system/src/Grav/Common/GPM/Remote/Grav.php b/system/src/Grav/Common/GPM/Remote/Grav.php index ed5582d57..bbca4c6c1 100644 --- a/system/src/Grav/Common/GPM/Remote/Grav.php +++ b/system/src/Grav/Common/GPM/Remote/Grav.php @@ -38,7 +38,7 @@ class Grav extends AbstractPackageCollection */ public function getAssets() { - return $this->data->assets; + return $this->data['assets']; } /** @@ -50,11 +50,11 @@ class Grav extends AbstractPackageCollection public function getChangelog($diff = null) { if (!$diff) { - return $this->data->changelog; + return $this->data['changelog']; } $diffLog = []; - foreach ($this->data->changelog as $version => $changelog) { + foreach ($this->data['changelog'] as $version => $changelog) { preg_match("/[\d\.]+/", $version, $cleanVersion); if (!$cleanVersion || version_compare($diff, $cleanVersion[0], ">=")) { continue; } diff --git a/system/src/Grav/Console/Gpm/SelfupgradeCommand.php b/system/src/Grav/Console/Gpm/SelfupgradeCommand.php index 7893f90d3..871c04a32 100644 --- a/system/src/Grav/Console/Gpm/SelfupgradeCommand.php +++ b/system/src/Grav/Console/Gpm/SelfupgradeCommand.php @@ -84,7 +84,7 @@ class SelfupgradeCommand extends Command $this->setupConsole($input, $output); $this->upgrader = new Upgrader($this->input->getOption('force')); - + $update = $this->upgrader->getAssets()['grav-update']; $local = $this->upgrader->getLocalVersion(); $remote = $this->upgrader->getRemoteVersion(); @@ -95,8 +95,6 @@ class SelfupgradeCommand extends Command exit; } - $update = $this->upgrader->getAssets()->{'grav-update'}; - $questionHelper = $this->getHelper('question'); $skipPrompt = $this->input->getOption('all-yes'); @@ -141,7 +139,7 @@ class SelfupgradeCommand extends Command $this->output->writeln(""); $this->output->writeln("Preparing to upgrade to v$remote.."); - $this->output->write(" |- Downloading upgrade [" . $this->formatBytes($update->size) . "]... 0%"); + $this->output->write(" |- Downloading upgrade [" . $this->formatBytes($update['size']) . "]... 0%"); $this->file = $this->download($update); $this->output->write(" |- Installing upgrade... ");