mirror of
https://github.com/getgrav/grav.git
synced 2025-12-05 15:29:57 +01:00
Ensuring gpm selfupgrades doesn't continue if PHP min version requirement isn't met. Gracefully abort with error and details.
This commit is contained in:
@@ -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("<red>ATTENTION:</red>");
|
||||
$this->output->writeln(" Grav has increased the minimum PHP requirement.");
|
||||
$this->output->writeln(" You are currently running PHP <red>" . PHP_VERSION . "</red>, but PHP <green>" . GRAV_PHP_MIN . "</green> is required.");
|
||||
$this->output->writeln(" Additional informations: <white>http://getgrav.org/blog/changing-php-requirements-to-5.5</white>");
|
||||
$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;
|
||||
|
||||
Reference in New Issue
Block a user