diff --git a/CHANGELOG.md b/CHANGELOG.md index a980a9221..4196bfc67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# v1.7.2 +# v1.7.3 ## 01/21/2021 1. [](#improved) @@ -12,6 +12,12 @@ * Fixed Clockwork debugger in sub-folder multi-site setups * Fixed `Unsupported option "curl" passed to "Symfony\Component\HttpClient\CurlHttpClient"` in `bin/gpm selfupgrade` [#3165](https://github.com/getgrav/grav/issues/3165) +# v1.7.2 +## 01/21/2021 + +1. [](#improved) + * This release was pulled due to a bug in the installer, 1.7.3 replaces it. + # v1.7.1 ## 01/20/2021 diff --git a/system/defines.php b/system/defines.php index 5b20589d1..8bc03f89b 100644 --- a/system/defines.php +++ b/system/defines.php @@ -8,8 +8,8 @@ // Some standard defines define('GRAV', true); -define('GRAV_VERSION', '1.7.2'); -define('GRAV_SCHEMA', '1.7.2_2021-01-21_1'); +define('GRAV_VERSION', '1.7.3'); +define('GRAV_SCHEMA', '1.7.0_2020-11-20_1'); define('GRAV_TESTING', false); // PHP minimum requirement diff --git a/system/src/Grav/Console/Gpm/DirectInstallCommand.php b/system/src/Grav/Console/Gpm/DirectInstallCommand.php index d551928ff..8712916c0 100644 --- a/system/src/Grav/Console/Gpm/DirectInstallCommand.php +++ b/system/src/Grav/Console/Gpm/DirectInstallCommand.php @@ -113,7 +113,6 @@ class DirectInstallCommand extends GpmCommand $io->newLine(); $io->writeln("Preparing to install {$package_file}"); - if (Response::isRemote($package_file)) { $io->write(' |- Downloading package... 0%'); try { @@ -131,7 +130,7 @@ class DirectInstallCommand extends GpmCommand $io->write(' |- Downloading package... 100%'); $io->newLine(); } - } else { + } elseif (is_file($package_file)) { $io->write(' |- Copying package... 0%'); $zip = GPM::copyPackage($package_file, $tmp_zip); if ($zip) { diff --git a/system/src/Grav/Console/Gpm/SelfupgradeCommand.php b/system/src/Grav/Console/Gpm/SelfupgradeCommand.php index ab9fec713..ac8d4d9b6 100644 --- a/system/src/Grav/Console/Gpm/SelfupgradeCommand.php +++ b/system/src/Grav/Console/Gpm/SelfupgradeCommand.php @@ -131,7 +131,8 @@ class SelfupgradeCommand extends GpmCommand $io->writeln("which was released on {$release}"); $config = Grav::instance()['config']; - if ($config->get('versions.core.grav.schema') !== GRAV_SCHEMA) { + $schema = $config->get('versions.core.grav.schema'); + if ($schema !== GRAV_SCHEMA && version_compare($schema, GRAV_SCHEMA, '<')) { $io->newLine(); $io->writeln('However post-install scripts have not been run.'); if (!$this->all_yes) { diff --git a/system/src/Grav/Console/GravCommand.php b/system/src/Grav/Console/GravCommand.php index 41fe61c0d..4634a1fdb 100644 --- a/system/src/Grav/Console/GravCommand.php +++ b/system/src/Grav/Console/GravCommand.php @@ -30,7 +30,11 @@ class GravCommand extends Command { $this->setupConsole($input, $output); - $this->initializeGrav(); + // Old versions of Grav called this command after grav upgrade. + // We need make this command to work with older ConsoleTrait: + if (method_exists($this, 'initializeGrav')) { + $this->initializeGrav(); + } return $this->serve(); } diff --git a/system/src/Grav/Installer/Install.php b/system/src/Grav/Installer/Install.php index 56696b218..d10427489 100644 --- a/system/src/Grav/Installer/Install.php +++ b/system/src/Grav/Installer/Install.php @@ -218,21 +218,16 @@ ERR; throw new RuntimeException('Grav has already been installed here!', 400); } - // Make sure that none of the Grav\Installer classes have been loaded, otherwise installation may fail! + // Load the installer classes. foreach ($this->classMap as $class_name => $path) { + // Make sure that none of the Grav\Installer classes have been loaded, otherwise installation may fail! if (class_exists($class_name, false)) { throw new RuntimeException(sprintf('Cannot update Grav, class %s has already been loaded!', $class_name), 500); } + + require $path; } - $grav = Grav::instance(); - - /** @var ClassLoader $loader */ - $loader = $grav['loader']; - - // Override Grav\Installer classes by using this version of Grav. - $loader->addClassMap($this->classMap); - $this->legacySupport(); $this->location = dirname($location, 4); diff --git a/system/src/Grav/Installer/updates/1.7.2_2021-01-21_1.php b/system/src/Grav/Installer/updates/1.7.2_2021-01-21_1.php deleted file mode 100644 index d10e1bec2..000000000 --- a/system/src/Grav/Installer/updates/1.7.2_2021-01-21_1.php +++ /dev/null @@ -1,26 +0,0 @@ - null, - 'postflight' => - function () { - // Only reset GPM releases value if upgrading from Grav 1.7 RC. - if (version_compare(GRAV_VERSION, '1.7', '<')) { - return; - } - - /** @var VersionUpdate $this */ - try { - // Keep old defaults for backwards compatibility. - $yaml = YamlUpdater::instance(GRAV_ROOT . '/user/config/system.yaml'); - $yaml->undefine('gpm.releases'); - $yaml->save(); - } catch (\Exception $e) { - throw new InstallException('Could not update system configuration to maintain backwards compatibility', $e); - } - } -];