ExpireAccessTokensCommand
extends AbstractExpireCommand
in package
Console command: expire access tokens.
Tags
Table of Contents
- $commandDescription : string
- Help description for the command.
- $defaultAge : int|null
- Default age of rows (in days) to delete. $minAge is used if $defaultAge is null.
- $minAge : int
- Minimum legal age (in days) of rows to delete.
- $rowLabel : string
- Label to use for rows in help messages.
- $service : DeleteExpiredInterface
- $table : DeleteExpiredInterface
- Table on which to expire rows
- __construct() : mixed
- Constructor
- configure() : void
- Configure the command.
- execute() : int
- Run the command.
- getDateThreshold() : DateTime
- Convert days to a date threshold
- getTimestampedMessage() : string
- Add a time stamp to a message
Properties
$commandDescription
Help description for the command.
protected
string
$commandDescription
= 'Database access_token table cleanup'
$defaultAge
Default age of rows (in days) to delete. $minAge is used if $defaultAge is null.
protected
int|null
$defaultAge
= null
$minAge
Minimum legal age (in days) of rows to delete.
protected
int
$minAge
= 2
$rowLabel
Label to use for rows in help messages.
protected
string
$rowLabel
= 'access tokens'
$service
protected
DeleteExpiredInterface
$service
$table
Table on which to expire rows
protected
DeleteExpiredInterface
$table
Methods
__construct()
Constructor
public
__construct(DeleteExpiredInterface $service[, string|null $name = null ]) : mixed
Parameters
- $service : DeleteExpiredInterface
-
Service on which to expire rows
- $name : string|null = null
-
The name of the command; passing null means it must be set in configure()
Return values
mixed —configure()
Configure the command.
protected
configure() : void
Return values
void —execute()
Run the command.
protected
execute(InputInterface $input, OutputInterface $output) : int
Parameters
- $input : InputInterface
-
Input object
- $output : OutputInterface
-
Output object
Return values
int —0 for success
getDateThreshold()
Convert days to a date threshold
protected
getDateThreshold(float $daysOld) : DateTime
Parameters
- $daysOld : float
-
Days before now
Return values
DateTime —getTimestampedMessage()
Add a time stamp to a message
protected
getTimestampedMessage(string $msg) : string
Parameters
- $msg : string
-
Message