![]() |
TYPO3
7.6
|
Static Public Member Functions | |
static | normalize ($cronCommand) |
Static Protected Member Functions | |
static | convertKeywordsToCronCommand ($cronCommand) |
static | normalizeFields ($cronCommand) |
static | splitFields ($cronCommand) |
static | normalizeMonthAndWeekdayField ($expression, $isMonthField=true) |
static | normalizeIntegerField ($expression, $lowerBound=0, $upperBound=59) |
static | convertRangeToListOfValues ($range) |
static | reduceListOfValuesByStepValue ($stepExpression) |
static | normalizeMonthAndWeekday ($expression, $isMonth=true) |
static | normalizeMonth ($month) |
static | normalizeWeekday ($weekday) |
Validate and normalize a cron command.
Special fields like three letter weekdays, ranges and steps are substituted to a comma separated list of integers. Example: '2-4 10-40/10 * mar * fri' will be normalized to '2,4 10,20,30,40 * * 3 1,2'
Definition at line 26 of file NormalizeCommand.php.
|
staticprotected |
Accept special cron command keywords and convert to standard cron syntax. Allowed keywords: , , , , , ,
string | $cronCommand | Cron command |
Definition at line 55 of file NormalizeCommand.php.
|
staticprotected |
Convert a range of integers to a list: 4-6 results in a string '4,5,6'
\InvalidArgumentException | If range can not be converted to list |
string | $range | Integer-integer |
Definition at line 217 of file NormalizeCommand.php.
References MathUtility\canBeInterpretedAsInteger(), and elseif.
|
static |
Main API method: Get the cron command and normalize it.
If no exception is thrown, the resulting cron command is validated and consists of five whitespace separated fields, which are either the letter '*' or a sorted, unique comma separated list of integers.
\InvalidArgumentException | cron command is invalid or out of bounds |
string | $cronCommand | The cron command to normalize |
Definition at line 40 of file NormalizeCommand.php.
Referenced by CronCommand\__construct(), and NormalizeCommandTest\normalizeConvertsCronCommand().
|
staticprotected |
Normalize cron command field to list of integers or *
string | $cronCommand | cron command |
Definition at line 86 of file NormalizeCommand.php.
|
staticprotected |
Normalize integer field.
\InvalidArgumentException | If field is invalid or out of bounds |
string | $expression | Expression |
int | $lowerBound | Lower limit of result list |
int | $upperBound | Upper limit of result list |
Definition at line 166 of file NormalizeCommand.php.
References MathUtility\canBeInterpretedAsInteger(), and elseif.
|
staticprotected |
Accept a string representation or integer number of a month like 'jan', 'February', 01, ... and convert to normalized integer value 1 .. 12
\InvalidArgumentException | If month string can not be converted to integer |
string | $month | Month representation |
Definition at line 325 of file NormalizeCommand.php.
|
staticprotected |
Dispatcher method for normalizeMonth and normalizeWeekday
string | $expression | Month or weekday to be normalized |
bool | $isMonth | TRUE if a month is handled, FALSE for weekday |
Definition at line 311 of file NormalizeCommand.php.
|
staticprotected |
Normalize month field.
string | $expression | Month field expression |
bool | $isMonthField | TRUE if month field is handled, FALSE for weekday field |
Definition at line 121 of file NormalizeCommand.php.
References elseif.
|
staticprotected |
Accept a string representation or integer number of a weekday like 'mon', 'Friday', 3, ... and convert to normalized integer value 1 .. 7
\InvalidArgumentException | If weekday string can not be converted |
string | $weekday | Weekday representation |
Definition at line 343 of file NormalizeCommand.php.
|
staticprotected |
Reduce a given list of values by step value. Following a range with ``/<number>'' specifies skips of the number's value through the range. 1-5/2 -> 1,3,5 2-10/3 -> 2,5,8
\InvalidArgumentException | if step value is invalid or if resulting list is empty |
string | $stepExpression | Step value expression |
Definition at line 261 of file NormalizeCommand.php.
References MathUtility\canBeInterpretedAsInteger().
|
staticprotected |
Split a given cron command like '23 * * * *' to an array with five fields.
\InvalidArgumentException | If splitted array does not contain five entries |
string | $cronCommand | cron command |
Definition at line 105 of file NormalizeCommand.php.