mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-12-05 15:29:58 +01:00
@@ -179,6 +179,14 @@ class SafeUpgradeManager
|
|||||||
*/
|
*/
|
||||||
public function restoreSnapshot(string $snapshotId): array
|
public function restoreSnapshot(string $snapshotId): array
|
||||||
{
|
{
|
||||||
|
if (!$this->isSafeUpgradeEnabled()) {
|
||||||
|
return [
|
||||||
|
'status' => 'error',
|
||||||
|
'message' => 'Safe upgrade is disabled in configuration.',
|
||||||
|
'manifest' => null,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$safeUpgrade = $this->getSafeUpgradeService();
|
$safeUpgrade = $this->getSafeUpgradeService();
|
||||||
$manifest = $safeUpgrade->rollback($snapshotId);
|
$manifest = $safeUpgrade->rollback($snapshotId);
|
||||||
@@ -935,6 +943,12 @@ class SafeUpgradeManager
|
|||||||
|
|
||||||
public function runSnapshot(array $options): array
|
public function runSnapshot(array $options): array
|
||||||
{
|
{
|
||||||
|
if (!$this->isSafeUpgradeEnabled()) {
|
||||||
|
return $this->errorResult('Safe upgrade is disabled in configuration.', [
|
||||||
|
'operation' => 'snapshot'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
$label = isset($options['label']) ? (string)$options['label'] : null;
|
$label = isset($options['label']) ? (string)$options['label'] : null;
|
||||||
if ($label !== null) {
|
if ($label !== null) {
|
||||||
$label = trim($label);
|
$label = trim($label);
|
||||||
|
|||||||
Reference in New Issue
Block a user