BackupCatalog
Reads the `{id}.manifest.json` files a {@see BackupManager} run leaves behind in a backup directory, and prunes the oldest ones. Stateless and filesystem-only — the manifest files themselves are the catalog; there is no separate index to keep in sync.
BackupCatalog::__construct()
public function __construct(string $backupDir):Parameters
| Name | Type | Description |
|---|---|---|
| $backupDir | string |
BackupCatalog::list()
public function list(): arrayAll backups in `$backupDir`, newest first (descending by `createdAt`).
BackupCatalog::prune()
public function prune(int $keep): arrayDelete every backup beyond the newest `$keep` (by `createdAt`), removing its `.sql`/`.tar.gz`/`.manifest.json` files. `prune(0)` deletes everything.
Parameters
| Name | Type | Description |
|---|---|---|
| $keep | int |
Returns
the ids of the backups that were deleted