Class Cron
The crontab editor class. You must call the commit() method to save your changes.
Methods summary
public
|
|
public
|
|
public
|
#
editCronJob( integer $index, string $command, integer|string $minute_const = '*', integer|string $hour = '*', integer|string $day = '*', integer|string $month = '*', integer|string $weekday = '*' )
Edits the cron job at index $index. Can be substituded with the full CRON expression (schedule + command) to perform a search - use with caution! |
protected
|
#
editCrontab( integer $index, string $command, integer|string $minute_const = '*', integer|string $hour = '*', integer|string $day = '*', integer|string $month = '*', integer|string $weekday = '*' )
Performs modifiation on the crontab file |
protected static
boolean
|
|
public
|
#
appendCrontab( string $command, integer|string $minute_const = '*', integer|string $hour = '*', integer|string $day = '*', integer|string $month = '*', integer|string $weekday = '*' )
Appends the crontab file |
public
|
|
public
|
|
public
|
|
public
|
#
autocommit( boolean|null $set = null )
If no parameter is passed or the parameter isn't TRUE/FALSE, returns the current autocommit setting, otherwise sets it. Use with caution! |
public
null|string
|
|
public
array
|
|
public
string
|
Magic methods summary
Constants summary
integer |
WEEKDAY_SUN
|
0 |
#
Defines the day of the week as Sunday |
integer |
WEEKDAY_MON
|
1 |
#
Defines the day of the week as Monday |
integer |
WEEKDAY_TUE
|
2 |
#
Defines the day of the week as Tuesday |
integer |
WEEKDAY_WED
|
3 |
#
Defines the day of the week as Wednesday |
integer |
WEEKDAY_THU
|
4 |
#
Defines the day of the week as Thursday |
integer |
WEEKDAY_FRI
|
5 |
#
Defines the day of the week as Friday |
integer |
WEEKDAY_SAT
|
6 |
#
Defines the day of the week as Saturday |
string |
CONST_YEARLY
|
'0 0 1 1 *' |
#
A pre-setting to run the cronjob yearly at 1 Jan, 00:00 |
string |
CONST_MONTHLY
|
'0 0 1 * *' |
#
A pre-setting to run the cronjob monthly at 00:00 |
string |
CONST_WEEKLY
|
'0 0 * * 0' |
#
A pre-setting to run the cronjob weekly on Sunday, 00:00 |
string |
CONST_DAILY
|
'0 0 * * *' |
#
A pre-setting to run the cronjob daily at 00:00 |
string |
CONST_HOURLY
|
'0 * * * *' |
#
A pre-setting to run the cronjob hourly at 00 minutes |
string |
CONST_REBOOT
|
'@reboot' |
#
A pre-setting to run the cronjob on server startup |
integer |
MONTH_JAN
|
1 |
#
Defines the month as January |
integer |
MONTH_FEB
|
2 |
#
Defines the month as February |
integer |
MONTH_MAR
|
3 |
#
Defines the month as March |
integer |
MONTH_APR
|
4 |
#
Defines the month as April |
integer |
MONTH_MAY
|
5 |
#
Defines the month as May |
integer |
MONTH_JUN
|
6 |
#
Defines the month as June |
integer |
MONTH_JUL
|
7 |
#
Defines the month as July |
integer |
MONTH_AUG
|
8 |
#
Defines the month as August |
integer |
MONTH_SEP
|
9 |
#
Defines the month as September |
integer |
MONTH_OCT
|
10 |
#
Defines the month as October |
integer |
MONTH_NOV
|
11 |
#
Defines the month as November |
integer |
MONTH_DEC
|
12 |
#
Defines the month as December |
Properties summary
protected static
array
|
$validConstants |
#
Array of valid CRON constants |
protected
array
|
$crontab |
#
The current crontab data |
protected
boolean
|
$autocommit |
#
Whether changes should be autocommited automatically |