Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques | |
__construct (string $expression, FieldFactoryInterface $fieldFactory=null) | |
setExpression (string $value) | |
setPart (int $position, string $value) | |
setMaxIterationCount (int $maxIterationCount) | |
getNextRunDate ($currentTime='now', int $nth=0, bool $allowCurrentDate=false, $timeZone=null) | |
getPreviousRunDate ($currentTime='now', int $nth=0, bool $allowCurrentDate=false, $timeZone=null) | |
getMultipleRunDates (int $total, $currentTime='now', bool $invert=false, bool $allowCurrentDate=false, $timeZone=null) | |
getExpression ($part=null) | |
getParts () | |
__toString () | |
isDue ($currentTime='now', $timeZone=null) | |
Fonctions membres publiques statiques | |
static | registerAlias (string $alias, string $expression) |
static | unregisterAlias (string $alias) |
static | supportsAlias (string $alias) |
static | getAliases () |
static | factory (string $expression, FieldFactoryInterface $fieldFactory=null) |
static | isValidExpression (string $expression) |
Champs de données | |
const | MINUTE = 0 |
const | HOUR = 1 |
const | DAY = 2 |
const | MONTH = 3 |
const | WEEKDAY = 4 |
const | YEAR = 5 |
const | MAPPINGS |
Fonctions membres protégées | |
getRunDate ($currentTime=null, int $nth=0, bool $invert=false, bool $allowCurrentDate=false, $timeZone=null) | |
determineTimeZone ($currentTime, ?string $timeZone) | |
Attributs protégés | |
$cronParts | |
$fieldFactory | |
$maxIterationCount = 1000 | |
Attributs protégés statiques | |
static | $order |
Attributs privés statiques | |
static | $registeredAliases = self::MAPPINGS |
CRON expression parser that can determine whether or not a CRON expression is due to run, the next run date and previous run date of a CRON expression. The determinations made by this class are accurate if checked run once per minute (seconds are dropped from date time comparisons).
Schedule parts must map to: minute [0-59], hour [0-23], day of month, month [1-12|JAN-DEC], day of week [1-7|MON-SUN], and an optional year.
__construct | ( | string | $expression, |
FieldFactoryInterface | $fieldFactory = null |
||
) |
Parse a CRON expression.
string | $expression | CRON expression (e.g. '8 * * * *') |
null | FieldFactoryInterface | $fieldFactory | Factory to create cron fields |
__toString | ( | ) |
Helper method to output the full expression.
|
protected |
Workout what timeZone should be used.
string | \DateTimeInterface | null | $currentTime | Relative calculation date |
string | null | $timeZone | TimeZone to use instead of the system default |
Références null.
|
static |
-ignore-next-line
|
static |
Returns all registered aliases as an associated array where the aliases are the key and their associated expressions are the values.
getExpression | ( | $part = null | ) |
Get all or part of the CRON expression.
int | string | null | $part | specify the part to retrieve or NULL to get the full cron schedule string |
Références null.
getMultipleRunDates | ( | int | $total, |
$currentTime = 'now' , |
|||
bool | $invert = false , |
||
bool | $allowCurrentDate = false , |
||
$timeZone = null |
|||
) |
Get multiple run dates starting at the current date or a specific date.
int | $total | Set the total number of dates to calculate |
string | \DateTimeInterface | null | $currentTime | Relative calculation date |
bool | $invert | Set to TRUE to retrieve previous dates |
bool | $allowCurrentDate | Set to TRUE to return the current date if it matches the cron expression |
null | string | $timeZone | TimeZone to use instead of the system default |
getNextRunDate | ( | $currentTime = 'now' , |
|
int | $nth = 0 , |
||
bool | $allowCurrentDate = false , |
||
$timeZone = null |
|||
) |
Get a next run date relative to the current date or a specific date
string | \DateTimeInterface | $currentTime | Relative calculation date |
int | $nth | Number of matches to skip before returning a matching next run date. 0, the default, will return the current date and time if the next run date falls on the current date and time. Setting this value to 1 will skip the first match and go to the second match. Setting this value to 2 will skip the first 2 matches and so on. |
bool | $allowCurrentDate | Set to TRUE to return the current date if it matches the cron expression. |
null | string | $timeZone | TimeZone to use instead of the system default |
getParts | ( | ) |
Gets the parts of the cron expression as an array.
getPreviousRunDate | ( | $currentTime = 'now' , |
|
int | $nth = 0 , |
||
bool | $allowCurrentDate = false , |
||
$timeZone = null |
|||
) |
Get a previous run date relative to the current date or a specific date.
string | \DateTimeInterface | $currentTime | Relative calculation date |
int | $nth | Number of matches to skip before returning |
bool | $allowCurrentDate | Set to TRUE to return the current date if it matches the cron expression |
null | string | $timeZone | TimeZone to use instead of the system default |
|
protected |
Get the next or previous run date of the expression relative to a date.
string | \DateTimeInterface | null | $currentTime | Relative calculation date |
int | $nth | Number of matches to skip before returning |
bool | $invert | Set to TRUE to go backwards in time |
bool | $allowCurrentDate | Set to TRUE to return the current date if it matches the cron expression |
string | null | $timeZone | TimeZone to use instead of the system default |
Références $b, $currentDate, $field, $fields, $i, $parts, $position, class, elseif, et null.
isDue | ( | $currentTime = 'now' , |
|
$timeZone = null |
|||
) |
Determine if the cron is due to run based on the current date or a specific date. This method assumes that the current number of seconds are irrelevant, and should be called once per minute.
string | \DateTimeInterface | $currentTime | Relative calculation date |
null | string | $timeZone | TimeZone to use instead of the system default |
|
static |
Validate a CronExpression.
string | $expression | the CRON expression to validate |
|
static |
Registered a user defined CRON Expression Alias.
LogicException | If the expression or the alias name are invalid or if the alias is already registered. |
setExpression | ( | string | $value | ) |
setMaxIterationCount | ( | int | $maxIterationCount | ) |
Set max iteration count for searching next run dates.
int | $maxIterationCount | Max iteration count when searching for next run date |
Références $this.
setPart | ( | int | $position, |
string | $value | ||
) |
|
static |
Tells whether a CRON Expression alias is registered.
|
static |
Unregistered a user defined CRON Expression Alias.
LogicException | If the user tries to unregister a built-in alias |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprivate |
const DAY = 2 |
const HOUR = 1 |
const MAPPINGS |
const MINUTE = 0 |
const MONTH = 3 |
const WEEKDAY = 4 |
const YEAR = 5 |