Minor fixes for Grav updater

This commit is contained in:
Matias Griese 2021-12-02 14:32:06 +02:00
parent ecb2d31df0
commit ae74f29b69
2 changed files with 12 additions and 5 deletions

View File

@ -36,9 +36,11 @@ final class Install
'php' => [
'name' => 'PHP',
'versions' => [
'7.4' => '7.4.0',
'8.1' => '8.1.0',
'8.0' => '8.0.0',
'7.4' => '7.4.1',
'7.3' => '7.3.6',
'' => '7.4.12'
'' => '8.0.13'
]
],
'grav' => [
@ -114,7 +116,7 @@ final class Install
/** @var string|null */
private $location;
/** @var VersionUpdater */
/** @var VersionUpdater|null */
private $updater;
/** @var static */
@ -250,6 +252,11 @@ ERR;
}
try {
if (null === $this->updater) {
$versions = Versions::instance(USER_DIR . 'config/versions.yaml');
$this->updater = new VersionUpdater('core/grav', __DIR__ . '/updates', $this->getVersion(), $versions);
}
// Update user/config/version.yaml before copying the files to avoid frontend from setting the version schema.
$this->updater->install();
@ -280,7 +287,7 @@ ERR;
public function finalize(): void
{
// Finalize can be run without installing Grav first.
if (!$this->updater) {
if (null === $this->updater) {
$versions = Versions::instance(USER_DIR . 'config/versions.yaml');
$this->updater = new VersionUpdater('core/grav', __DIR__ . '/updates', GRAV_VERSION, $versions);
$this->updater->install();

View File

@ -50,7 +50,7 @@ final class VersionUpdate
public function getPatch(): string
{
return $this->date;
return $this->patch;
}
public function getUpdater(): VersionUpdater