From 00ecfb30f360f6e9054fa1350e8accad8a91e274 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Fri, 18 Dec 2015 13:38:28 -0800 Subject: [PATCH] Ensuring gpm selfupgrades doesn't continue if PHP min version requirement isn't met. Gracefully abort with error and details. --- system/src/Grav/Console/Gpm/SelfupgradeCommand.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/system/src/Grav/Console/Gpm/SelfupgradeCommand.php b/system/src/Grav/Console/Gpm/SelfupgradeCommand.php index d2ef2d2d6..ae1bc18e4 100644 --- a/system/src/Grav/Console/Gpm/SelfupgradeCommand.php +++ b/system/src/Grav/Console/Gpm/SelfupgradeCommand.php @@ -82,6 +82,18 @@ class SelfupgradeCommand extends ConsoleCommand $remote = $this->upgrader->getRemoteVersion(); $release = strftime('%c', strtotime($this->upgrader->getReleaseDate())); + if (!$this->upgrader->meetsRequirements()) { + $this->output->writeln(""); + $this->output->writeln("ATTENTION:"); + $this->output->writeln(" Grav has increased the minimum PHP requirement."); + $this->output->writeln(" You are currently running PHP " . PHP_VERSION . ", but PHP " . GRAV_PHP_MIN . " is required."); + $this->output->writeln(" Additional informations: http://getgrav.org/blog/changing-php-requirements-to-5.5"); + $this->output->writeln(""); + $this->output->writeln("Selfupgrade aborted."); + $this->output->writeln(""); + exit; + } + if (!$this->upgrader->isUpgradable()) { $this->output->writeln("You are already running the latest version of Grav (v" . $local . ") released on " . $release); exit;