mirror of
https://github.com/getgrav/grav.git
synced 2026-07-07 15:13:17 +02:00
Fixed a bug in post-install methods
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
// Some standard defines
|
||||
define('GRAV', true);
|
||||
define('GRAV_VERSION', '1.7.2');
|
||||
define('GRAV_SCHEMA', '1.7.2_2021-01-21_1');
|
||||
define('GRAV_SCHEMA', '1.7.3_2021-01-21_1');
|
||||
define('GRAV_TESTING', false);
|
||||
|
||||
// PHP minimum requirement
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -17,8 +17,10 @@ return [
|
||||
try {
|
||||
// Keep old defaults for backwards compatibility.
|
||||
$yaml = YamlUpdater::instance(GRAV_ROOT . '/user/config/system.yaml');
|
||||
$yaml->undefine('gpm.releases');
|
||||
$yaml->save();
|
||||
if (!$yaml->isHandWritten()) {
|
||||
$yaml->undefine('gpm.releases');
|
||||
$yaml->save();
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw new InstallException('Could not update system configuration to maintain backwards compatibility', $e);
|
||||
}
|
||||
Reference in New Issue
Block a user