![]() |
TYPO3
7.6
|
Public Member Functions | |
__construct ($cronCommand, $timestamp=false) | |
calculateNextValue () | |
getTimestamp () | |
getCronCommandSections () | |
Protected Member Functions | |
minuteAndHourMatchesCronCommand ($timestamp) | |
dayMatchesCronCommand ($timestamp) | |
isInCommandList ($commandExpression, $numberToMatch) | |
numberOfSecondsInDay ($timestamp) | |
roundTimestamp ($timestamp) | |
Protected Attributes | |
$cronCommandSections | |
$timestamp | |
This class provides calculations for the cron command format.
Definition at line 20 of file CronCommand.php.
__construct | ( | $cronCommand, | |
$timestamp = false |
|||
) |
Constructor
string | $cronCommand | The cron command can hold any combination documented as valid |
bool | int | $timestamp | Optional start time, used in unit tests |
Definition at line 54 of file CronCommand.php.
References CronCommand\$timestamp, NormalizeCommand\normalize(), and CronCommand\roundTimestamp().
calculateNextValue | ( | ) |
Calculates the date of the next execution.
\RuntimeException |
Definition at line 76 of file CronCommand.php.
References CronCommand\dayMatchesCronCommand(), CronCommand\getTimestamp(), CronCommand\minuteAndHourMatchesCronCommand(), and CronCommand\numberOfSecondsInDay().
|
protected |
Determine if current timestamp matches day of month, month and day of week cron command restriction
int | $timestamp | to test |
Definition at line 156 of file CronCommand.php.
References CronCommand\$timestamp, and CronCommand\isInCommandList().
Referenced by CronCommand\calculateNextValue().
getCronCommandSections | ( | ) |
Get cron command sections. Array of strings, each containing either a list of comma separated integers or *
Definition at line 127 of file CronCommand.php.
References CronCommand\$cronCommandSections.
getTimestamp | ( | ) |
Get next timestamp
Definition at line 116 of file CronCommand.php.
References CronCommand\$timestamp.
Referenced by CronCommand\calculateNextValue().
|
protected |
Determine if a given number validates a cron command section. The given cron command must be a 'normalized' list with only comma separated integers or '*'
string | $commandExpression,: | cron command |
int | $numberToMatch,: | number to look up |
Definition at line 188 of file CronCommand.php.
Referenced by CronCommand\dayMatchesCronCommand(), and CronCommand\minuteAndHourMatchesCronCommand().
|
protected |
Determine if current timestamp matches minute and hour cron command restriction.
int | $timestamp | to test |
Definition at line 138 of file CronCommand.php.
References CronCommand\$timestamp, and CronCommand\isInCommandList().
Referenced by CronCommand\calculateNextValue().
|
protected |
Helper method to calculate number of seconds in a day.
This is not always 86400 (60*60*24) and depends on the timezone: Some countries like Germany have a summertime / wintertime switch, on every last sunday in march clocks are forwarded by one hour (set from 2:00 to 3:00), and on last sunday of october they are set back one hour (from 3:00 to 2:00). This shortens and lengthens the length of a day by one hour.
int | $timestamp | Unix timestamp |
Definition at line 211 of file CronCommand.php.
References CronCommand\$timestamp.
Referenced by CronCommand\calculateNextValue().
|
protected |
Round a timestamp down to full minute.
int | $timestamp | Unix timestamp |
Definition at line 226 of file CronCommand.php.
References CronCommand\$timestamp.
Referenced by CronCommand\__construct().
|
protected |
Normalized sections of the cron command. Allowed are comma separated lists of integers and the character '*'
field lower and upper bound
minute 0-59 hour 0-23 day of month 1-31 month 1-12 day of week 1-7
Definition at line 36 of file CronCommand.php.
Referenced by CronCommand\getCronCommandSections().
|
protected |
Timestamp of next execution date. This value starts with 'now + 1 minute' if not set externally by unit tests. After a call to calculateNextValue() it holds the timestamp of the next execution date which matches the cron command restrictions.
Definition at line 44 of file CronCommand.php.
Referenced by CronCommand\__construct(), CronCommand\dayMatchesCronCommand(), CronCommand\getTimestamp(), CronCommand\minuteAndHourMatchesCronCommand(), CronCommand\numberOfSecondsInDay(), and CronCommand\roundTimestamp().