\Hazaar
Cron
This class can be used to parse cron strings and compute schedules.

It can parse a given string with a schedule specification in cron format. The class can compute the last and the next schedule times relative to a given time.

Example

$cron = new \Hazaar\Cron('0,30 9-17 \* \* 1-5');$next = $cron->getNextOccurrence(); This will get the next occurrence from the schedule which should return dates and times for every 0th and 30th minute between 9am and 5pm, Monday to Friday. Summary Methods Properties Constants No constants Properties$intervals
$intervals Named intervals.$keywords
$keywords Possible keywords for months/weekdays.$pcron
$pcron$ranges
$ranges Ranges. Methods __construct() __construct($expression)

Parameters

 $expression No description arrayReverse() arrayReverse($cron) : Array
Reverses all sub-arrays of our cron array.

The reversed values are used for calculations that are run when getLastOccurence() is called.

 $cron mixed Returns  \Array calculateDateTime() calculateDateTime($rtime, $next = true) : int|null Calculates the time and date at which the next/last call of a cronjob is/was due. Parameters $rtime mixed reference-time $next bool true = nextOccurence, false = lastOccurence Returns  \int|null expandSegment() expandSegment($idx, $segment) : mixed Analyses a single segment Parameters $idx int $segment string Returns  mixed findValue() findValue($value, $data,$next = true) : mixed
Checks if the given value exists in an array.

Returns

 mixed The next value or false if there isn't one.
getLastOccurrence()

Returns

 \int|null
getNextOccurrence()

Returns

 \int|null
getTimestamp()

 \Array
parse()

 mixed
parseAtom()

 array