KMP PHP API Reference

PlatformJobRunner
in package

Drains executable Platform Admin jobs.

Table of Contents

Constants

JOB_BACKUPS_PRUNE  : mixed = 'backups_prune'
JOB_PLATFORM_BACKUP  : mixed = \App\Services\Backups\PlatformDatabaseBackupSer...
JOB_TENANT_BACKUP  : mixed = \App\Services\Backups\TenantBackupService::JOB_...
JOB_TENANT_PROVISION  : mixed = 'tenant_provision'
JOB_TENANT_RESTORE  : mixed = \App\Services\Backups\TenantRestoreService::JOB...
EXECUTABLE_JOB_TYPES  : array<int, string> = [self::JOB_TENANT_PROVISION, self::JOB_TENANT_B...

Properties

$connection  : Connection|null

Methods

__construct()  : mixed
Constructor.
run()  : array{claimed: int, completed: int, failed: int}
supports()  : bool
Return whether this runner can execute a platform job type.
claimQueuedJobs()  : array<int, array<string, mixed>>
connection()  : Connection
Return the platform connection.
markCompleted()  : void
markFailed()  : string
now()  : string
Return current UTC database timestamp.
parameters()  : array<string, mixed>
recordEvent()  : void
requiredString()  : string
retentionDays()  : int
runBackupsPrune()  : void
runCommand()  : void
runJob()  : void
runPlatformBackup()  : void
runTenantBackup()  : void
runTenantProvisioning()  : void
runTenantRestore()  : void
tenantRestoreMode()  : string
tenantRestoreSlug()  : string

Constants

JOB_PLATFORM_BACKUP

public mixed JOB_PLATFORM_BACKUP = \App\Services\Backups\PlatformDatabaseBackupService::JOB_TYPE

JOB_TENANT_BACKUP

public mixed JOB_TENANT_BACKUP = \App\Services\Backups\TenantBackupService::JOB_TYPE

JOB_TENANT_RESTORE

public mixed JOB_TENANT_RESTORE = \App\Services\Backups\TenantRestoreService::JOB_TYPE

EXECUTABLE_JOB_TYPES

private array<int, string> EXECUTABLE_JOB_TYPES = [self::JOB_TENANT_PROVISION, self::JOB_TENANT_BACKUP, self::JOB_TENANT_RESTORE, self::JOB_PLATFORM_BACKUP, self::JOB_BACKUPS_PRUNE]

Properties

Methods

__construct()

Constructor.

public __construct([Connection|null $connection = null ]) : mixed
Parameters
$connection : Connection|null = null

Optional platform connection override

run()

public run(int $limit, callable $commandRunner) : array{claimed: int, completed: int, failed: int}
Parameters
$limit : int
$commandRunner : callable

Callable receiving (object|string $command, list $args): int|null

Return values
array{claimed: int, completed: int, failed: int}

supports()

Return whether this runner can execute a platform job type.

public static supports(string $jobType) : bool
Parameters
$jobType : string
Return values
bool

claimQueuedJobs()

private claimQueuedJobs(int $limit) : array<int, array<string, mixed>>
Parameters
$limit : int
Return values
array<int, array<string, mixed>>

connection()

Return the platform connection.

private connection() : Connection
Return values
Connection

markCompleted()

private markCompleted(array<string, mixed> $job) : void
Parameters
$job : array<string, mixed>

markFailed()

private markFailed(array<string, mixed> $job, Throwable $exception) : string
Parameters
$job : array<string, mixed>

Platform job row

$exception : Throwable
Return values
string

now()

Return current UTC database timestamp.

private now() : string
Return values
string

parameters()

private parameters(array<string, mixed> $job) : array<string, mixed>
Parameters
$job : array<string, mixed>

Platform job row

Return values
array<string, mixed>

recordEvent()

private recordEvent(array<string, mixed> $job, string $level, string $code, string $message) : void
Parameters
$job : array<string, mixed>
$level : string
$code : string
$message : string

requiredString()

private requiredString(array<string, mixed> $parameters, string $key) : string
Parameters
$parameters : array<string, mixed>
$key : string
Return values
string

retentionDays()

private retentionDays(array<string, mixed> $parameters) : int
Parameters
$parameters : array<string, mixed>
Return values
int

runBackupsPrune()

private runBackupsPrune(array<string, mixed> $job, callable $commandRunner) : void
Parameters
$job : array<string, mixed>

Retention job

$commandRunner : callable

Administrative command runner

runCommand()

private runCommand(callable $commandRunner, Command> $command, array<int, string> $arguments) : void
Parameters
$commandRunner : callable
$command : Command>
$arguments : array<int, string>

runJob()

private runJob(array<string, mixed> $job, callable $commandRunner) : void
Parameters
$job : array<string, mixed>

Platform job row

$commandRunner : callable

Callable receiving (object|string $command, list $args): int|null

runPlatformBackup()

private runPlatformBackup(array<string, mixed> $job, callable $commandRunner) : void
Parameters
$job : array<string, mixed>
$commandRunner : callable

runTenantBackup()

private runTenantBackup(array<string, mixed> $job, callable $commandRunner) : void
Parameters
$job : array<string, mixed>
$commandRunner : callable

runTenantProvisioning()

private runTenantProvisioning(array<string, mixed> $job, callable $commandRunner) : void
Parameters
$job : array<string, mixed>

Platform job row

$commandRunner : callable

Callable receiving (object|string $command, list $args): int|null

runTenantRestore()

private runTenantRestore(array<string, mixed> $job, callable $commandRunner) : void
Parameters
$job : array<string, mixed>
$commandRunner : callable

tenantRestoreMode()

private tenantRestoreMode(array<string, mixed> $parameters) : string
Parameters
$parameters : array<string, mixed>
Return values
string

tenantRestoreSlug()

private tenantRestoreSlug(array<string, mixed> $parameters) : string
Parameters
$parameters : array<string, mixed>
Return values
string
On this page

Search results