mirror of
https://github.com/getgrav/grav.git
synced 2025-10-26 07:56:07 +01:00
Merge branch '1.8' of github.com:getgrav/grav into 1.8
Signed-off-by: Andy Miller <rhuk@mac.com>
This commit is contained in:
@@ -303,7 +303,7 @@ class RecoveryManager
|
||||
*/
|
||||
private function windowPath(): string
|
||||
{
|
||||
return $this->rootPath . '/system/recovery.window';
|
||||
return $this->userPath . '/data/recovery.window';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -403,7 +403,9 @@ class RecoveryManager
|
||||
'expires_at' => $createdAt + $ttl,
|
||||
];
|
||||
|
||||
file_put_contents($this->windowPath(), json_encode($payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n");
|
||||
$path = $this->windowPath();
|
||||
Folder::create(dirname($path));
|
||||
file_put_contents($path, json_encode($payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -418,9 +418,15 @@ class SafeUpgradeService
|
||||
*/
|
||||
public function clearRecoveryFlag(): void
|
||||
{
|
||||
$flag = $this->rootPath . '/user/data/recovery.flag';
|
||||
if (is_file($flag)) {
|
||||
@unlink($flag);
|
||||
$paths = [
|
||||
$this->rootPath . '/user/data/recovery.flag',
|
||||
$this->rootPath . '/user/data/recovery.window',
|
||||
];
|
||||
|
||||
foreach ($paths as $path) {
|
||||
if (is_file($path)) {
|
||||
@unlink($path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -235,6 +235,8 @@ class UpdateCommand extends GpmCommand
|
||||
return 1;
|
||||
}
|
||||
|
||||
$recovery->closeUpgradeWindow();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user