KMP PHP API Reference

RestoreStatusService
in package

Tracks restore lock and restore progress in shared cache.

Table of Contents

Constants

CACHE_CONFIG  = 'restore_status'
DEFAULT_LOCK_TTL_SECONDS  = 1800
LOCK_KEY  = 'restore.lock'
STALE_PROGRESS_SECONDS  = 180
STATUS_KEY  = 'restore.status'

Methods

acquireLock()  : bool
Acquire restore lock and initialize running status.
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.
nowIso()  : string
Now iso.
readActiveLock()  : array<string, mixed>|null
readStatus()  : array<string, mixed>
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

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
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

readActiveLock()

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

readStatus()

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

writeStatus()

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

        
On this page

Search results