BackupObjectStorage
in package
FinalYes
Stores encrypted backup archives through KMP's configured Flysystem backend.
Table of Contents
Constants
- URI_PREFIX : mixed = 'backup://'
Properties
- $storage : BackupStorageService
- $workRoot : string
Methods
- __construct() : mixed
- Constructor.
- delete() : void
- Delete an encrypted archive from its expected scope.
- retrieve() : TenantBackupStoredObject
- Retrieve an encrypted archive into a safe staging destination.
- store() : TenantBackupStoredObject
- Persist an encrypted archive and remove its staging file.
- workPath() : string
- Return an isolated local staging path.
- assertSafeDestination() : void
- Reject invalid staging destinations.
- assertSafeSegment() : void
- Reject unsafe local path segments.
- ensureDirectory() : void
- Create a private staging directory when needed.
- objectPathFromUri() : string
- Resolve and scope-check a backup object URI.
- validatedObjectPath() : string
- Validate the configured-storage object key.
Constants
URI_PREFIX
private
mixed
URI_PREFIX
= 'backup://'
Properties
$storage read-only
private
BackupStorageService
$storage
$workRoot read-only
private
string
$workRoot
= TMP . 'platform-backup-work'
Methods
__construct()
Constructor.
public
__construct(BackupStorageService $storage[, string $workRoot = TMP . 'platform-backup-work' ]) : mixed
Parameters
- $storage : BackupStorageService
- $workRoot : string = TMP . 'platform-backup-work'
delete()
Delete an encrypted archive from its expected scope.
public
delete(string $objectUri, string $expectedPrefix) : void
Parameters
- $objectUri : string
- $expectedPrefix : string
retrieve()
Retrieve an encrypted archive into a safe staging destination.
public
retrieve(string $objectUri, string $expectedPrefix, string $destinationPath) : TenantBackupStoredObject
Parameters
- $objectUri : string
- $expectedPrefix : string
- $destinationPath : string
Return values
TenantBackupStoredObjectstore()
Persist an encrypted archive and remove its staging file.
public
store(string $objectPath, string $encryptedPath) : TenantBackupStoredObject
Parameters
- $objectPath : string
- $encryptedPath : string
Return values
TenantBackupStoredObjectworkPath()
Return an isolated local staging path.
public
workPath(string $backupId, string $suffix) : string
Parameters
- $backupId : string
- $suffix : string
Return values
stringassertSafeDestination()
Reject invalid staging destinations.
private
assertSafeDestination(string $path) : void
Parameters
- $path : string
assertSafeSegment()
Reject unsafe local path segments.
private
assertSafeSegment(string $segment, string $label) : void
Parameters
- $segment : string
- $label : string
ensureDirectory()
Create a private staging directory when needed.
private
ensureDirectory(string $directory) : void
Parameters
- $directory : string
objectPathFromUri()
Resolve and scope-check a backup object URI.
private
objectPathFromUri(string $objectUri, string $expectedPrefix) : string
Parameters
- $objectUri : string
- $expectedPrefix : string
Return values
stringvalidatedObjectPath()
Validate the configured-storage object key.
private
validatedObjectPath(string $objectPath) : string
Parameters
- $objectPath : string