Reference in New Issue
Block a user
Delete Branch "fix/retention-remote-shared-helper"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Addresses two related asks: retention must apply to remote destinations, and all backup functions should live in shared helpers.
#229 — Retention now prunes remote copies
Previously retention deleted only the local record + archive +
.log; remote copies (SFTP/FTP/S3/Google Drive) grew unbounded.delete(string $remoteName): arraytoRemoteUploaderInterfaceand implemented it in all four uploaders. Deletes are idempotent (an already-absent remote file counts as success).RetentionManagernow removes each pruned archive from the profile's currently-enabled remotes — best-effort, failures logged, never blocking local pruning.restore.phpis intentionally NOT deleted — it's a single fixed-name file every backup overwrites, so newer backups still depend on it. (Deleting it during old-archive pruning would break restore for the copies that remain.)#230 — Shared-helper consolidation
RemoteUploaderFactory(new) — single home for the type→class map + key-prefixing that was duplicated verbatim inBackupEngineandSteppedBackupEngine; both now delegate to it (and retention uses it for deletion).RetentionManageris the single retention authority — takes the globalmax_age_days/max_backupsfallback and gainedpruneOrphans(). The system plugin's hourlydoCleanup()delegates to it; its duplicatedeleteBackupRecord()is removed. (Bonus: the plugin sweep now also pruneswarningrecords, not justcomplete.)cli/mokosuitebackup.phpnow run through the sharedBackupRunner(gaining the normalized complete/warning/fail status) instead ofnew BackupEngine().The dashboard AJAX
SteppedBackupEngineinteractive path is intentionally left separate.Verify
php -lclean on all 13 changed files.RetentionManager::prune()signature change is backward-compatible (new params default to 0); the two engine callers still pass 2 args.new BackupEngine()outsideBackupRunner;deleteBackupRecordfully removed.Refs #229 #230
https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i