Cron.
More...
Cron.
Definition at line 18 of file Cron.php.
Constructor.
- Parameters
-
EventsService | $events | Events service |
Translator | $translator | Translator service |
Definition at line 43 of file Cron.php.
Elgg\Cron::after |
( |
string |
$output, |
|
|
string |
$interval, |
|
|
\Elgg\Logger\Cron |
$cron_logger |
|
) |
| |
|
protected |
Printers handler result.
- Parameters
-
string | $output | Output string |
string | $interval | Interval name |
\Elgg\Logger\Cron | $cron_logger | Cron logger |
- Returns
- void
Definition at line 185 of file Cron.php.
Execute commands before cron interval is run.
- Parameters
-
string | $interval | Interval name |
\Elgg\Logger\Cron | $cron_logger | Cron logger |
null | \DateTime | $time | Time of the cron initialization (default: current service time) |
- Returns
- void
Definition at line 103 of file Cron.php.
Execute handlers attached to a specific cron interval.
- Parameters
-
string | $interval | Cron interval to execute |
\Elgg\Logger\Cron | $cron_logger | Cron logger |
string | $filename | Filename of the cron log |
null | \DateTime | $time | Time of cron initialization (default: current service time) |
- Returns
- string
Definition at line 133 of file Cron.php.
Elgg\Cron::getConfiguredIntervals |
( |
bool |
$only_names = false | ) |
|
Get the cron interval configuration.
- Parameters
-
bool | $only_names | Only return the names of the intervals |
- Returns
- array
- Since
- 3.2
Definition at line 282 of file Cron.php.
Elgg\Cron::getLastCompletion |
( |
string |
$interval | ) |
|
Get the time of the last completion of a cron interval.
- Parameters
-
string | $interval | cron interval |
- Returns
- null|DateTime
Definition at line 250 of file Cron.php.
Elgg\Cron::getLogFilename |
( |
string |
$interval, |
|
|
\DateTime |
$time = null |
|
) |
| |
|
protected |
Get a filename to log in.
- Parameters
-
string | $interval | cron interval to log |
\DateTime | null | $time | start time of the cron |
- Returns
- string
Definition at line 305 of file Cron.php.
Elgg\Cron::getLogs |
( |
string |
$interval, |
|
|
bool |
$filenames_only = false |
|
) |
| |
Get the log files for a given cron interval.
The results are sorted so the newest log is the first in the array
- Parameters
-
string | $interval | cron interval |
bool | $filenames_only | only return the filenames (default: false) |
- Returns
- array
Definition at line 209 of file Cron.php.
Elgg\Cron::logCompletion |
( |
string |
$interval | ) |
|
|
protected |
Log the completion time of a cron interval.
- Parameters
-
string | $interval | cron interval |
- Returns
- void
Definition at line 352 of file Cron.php.
Elgg\Cron::rotateLogs |
( |
string |
$interval | ) |
|
|
protected |
Rotate the log files.
- Parameters
-
string | $interval | cron interval |
- Returns
- void
Definition at line 328 of file Cron.php.
Elgg\Cron::run |
( |
array |
$intervals = null , |
|
|
bool |
$force = false |
|
) |
| |
Executes handlers for periods that have elapsed since last cron.
- Parameters
-
null | array | $intervals | Interval names to run (default: all cron intervals) |
bool | $force | Force cron jobs to run even they are not yet due |
- Returns
- Job[]
- Exceptions
-
Definition at line 55 of file Cron.php.
array Elgg\Cron::$default_intervals |
|
protected |
Initial value:= [
'minute' => '* * * * *'
Definition at line 25 of file Cron.php.
const Elgg\Cron::LOG_FILES_TO_KEEP = 5 |
|
protected |
The documentation for this class was generated from the following file: