CleanupExpiredTokensJob
extends MaintenanceJob
in package
Deletes expired email verification and password reset tokens.
Both token tables retain rows until they are explicitly removed; tokens are only deleted on use, so expired but unused tokens accumulate. This job purges any token whose expires_at is in the past.
Table of Contents
Methods
- getName() : string
- run() : bool
- Purge expired auth tokens.
- getBasePath() : string|null
- Resolve the application base path from the Registry.
- getConnection() : PDO|null
- Build a PDO connection from the application database settings.
- getSettings() : SettingManager|null
- Resolve the application SettingManager from the Registry.
- intArg() : int
- Read an integer argument with a default fallback.
Methods
getName()
public
getName() : string
Tags
Return values
stringrun()
Purge expired auth tokens.
public
run([array<string|int, mixed> $argv = [] ]) : bool
Parameters
- $argv : array<string|int, mixed> = []
Return values
bool —True on success.
getBasePath()
Resolve the application base path from the Registry.
protected
getBasePath() : string|null
Return values
string|nullgetConnection()
Build a PDO connection from the application database settings.
protected
getConnection() : PDO|null
Return values
PDO|null —Null when the connection cannot be established.
getSettings()
Resolve the application SettingManager from the Registry.
protected
getSettings() : SettingManager|null
Return values
SettingManager|null —Null when settings are unavailable.
intArg()
Read an integer argument with a default fallback.
protected
intArg(array<string|int, mixed> $argv, string $key, int $default) : int
Parameters
- $argv : array<string|int, mixed>
- $key : string
- $default : int