mirror of
https://github.com/getgrav/grav.git
synced 2025-10-26 07:56:07 +01:00
@@ -879,19 +879,8 @@ class SafeUpgradeService
|
||||
*/
|
||||
private function pruneOldSnapshots(): void
|
||||
{
|
||||
$files = glob($this->manifestStore . DIRECTORY_SEPARATOR . '*.json') ?: [];
|
||||
if (count($files) <= 3) {
|
||||
return;
|
||||
}
|
||||
|
||||
sort($files);
|
||||
$excess = array_slice($files, 0, count($files) - 3);
|
||||
foreach ($excess as $file) {
|
||||
$data = json_decode(file_get_contents($file), true);
|
||||
if (isset($data['backup_path']) && is_dir($data['backup_path'])) {
|
||||
Folder::delete($data['backup_path']);
|
||||
}
|
||||
@unlink($file);
|
||||
}
|
||||
// Retain all snapshots; administrators can prune manually if desired.
|
||||
// Legacy behaviour removed to ensure full history remains available.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user