KMP PHP API Reference

RestoreStatusService
in package

Tracks restore lock and restore progress in shared cache.

Table of Contents

Constants

CACHE_CONFIG  : mixed = 'restore_status'
DEFAULT_LOCK_TTL_SECONDS  : mixed = 1800
LOCK_KEY  : mixed = 'restore.lock'
MAX_LOG_ENTRIES  : mixed = 500
STALE_PROGRESS_SECONDS  : mixed = 900
STATUS_KEY  : mixed = 'restore.status'

Methods

acquireLock()  : bool
Acquire restore lock and initialize running status.
appendLog()  : void
Append a user-visible restore log line to the shared status payload.
getStatus()  : array<string, mixed>
Return current restore status payload.
isLocked()  : bool
Check if locked.
markCompleted()  : void
Mark restore status as completed and clear lock.
markFailed()  : void
Mark restore status as failed and clear lock.
releaseLock()  : void
Release the restore lock without changing status payload.
updateStatus()  : void
Mark status as running and update current phase message.
clearExpiredLock()  : void
Clear expired lock.
defaultStatus()  : array<string, mixed>
isExpired()  : bool
Check if expired.
isoAfterSeconds()  : string
Iso after seconds.
isOlderThanSeconds()  : bool
Check if older than seconds.
lockKey()  : string
Tenant-scoped restore lock cache key.
nowIso()  : string
Now iso.
readActiveLock()  : array<string, mixed>|null
readStatus()  : array<string, mixed>
statusKey()  : string
Tenant-scoped restore status cache key.
writeStatus()  : void

Constants

Methods

acquireLock()

Acquire restore lock and initialize running status.

public acquireLock([array<string, mixed> $context = [] ][, int|null $ttlSeconds = null ]) : bool
Parameters
$context : array<string, mixed> = []
$ttlSeconds : int|null = null
Return values
bool

appendLog()

Append a user-visible restore log line to the shared status payload.

public appendLog(string $message) : void
Parameters
$message : string

getStatus()

Return current restore status payload.

public getStatus() : array<string, mixed>
Return values
array<string, mixed>

markCompleted()

Mark restore status as completed and clear lock.

public markCompleted(string $message[, array<string, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string, mixed> = []

markFailed()

Mark restore status as failed and clear lock.

public markFailed(string $message[, array<string, mixed> $context = [] ]) : void

Set maintenance_required when the database may have been partially reset and normal controllers should not run against the current schema.

Parameters
$message : string
$context : array<string, mixed> = []

releaseLock()

Release the restore lock without changing status payload.

public releaseLock() : void

updateStatus()

Mark status as running and update current phase message.

public updateStatus(string $phase, string $message[, array<string, mixed> $context = [] ]) : void
Parameters
$phase : string
$message : string
$context : array<string, mixed> = []

defaultStatus()

private defaultStatus() : array<string, mixed>
Return values
array<string, mixed>

isExpired()

Check if expired.

private isExpired(string $isoValue) : bool
Parameters
$isoValue : string
Return values
bool

isoAfterSeconds()

Iso after seconds.

private isoAfterSeconds(int $seconds) : string
Parameters
$seconds : int
Return values
string

isOlderThanSeconds()

Check if older than seconds.

private isOlderThanSeconds(string $isoValue, int $seconds) : bool
Parameters
$isoValue : string
$seconds : int
Return values
bool

lockKey()

Tenant-scoped restore lock cache key.

private lockKey() : string
Return values
string

readActiveLock()

private readActiveLock() : array<string, mixed>|null
Return values
array<string, mixed>|null

readStatus()

private readStatus() : array<string, mixed>
Return values
array<string, mixed>

statusKey()

Tenant-scoped restore status cache key.

private statusKey() : string
Return values
string

writeStatus()

private writeStatus(array<string, mixed> $status) : void
Parameters
$status : array<string, mixed>
On this page

Search results