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 178 of file Cron.php.
Elgg\Cron::before |
( |
string |
$interval, |
|
|
\Elgg\Logger\Cron |
$cron_logger, |
|
|
\DateTimeImmutable |
$time |
|
) |
| |
|
protected |
Execute commands before cron interval is run.
- Parameters
-
string | $interval | Interval name |
\Elgg\Logger\Cron | $cron_logger | Cron logger |
\DateTimeImmutable | $time | Time of the cron initialization |
- Returns
- void
Definition at line 104 of file Cron.php.
Elgg\Cron::execute |
( |
string |
$interval, |
|
|
\Elgg\Logger\Cron |
$cron_logger, |
|
|
string |
$filename, |
|
|
\DateTimeImmutable |
$time |
|
) |
| |
|
protected |
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 |
\DateTimeImmutable | $time | Time of cron initialization |
- Returns
- string
Definition at line 130 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 275 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 243 of file Cron.php.
Elgg\Cron::getLogFilename |
( |
string |
$interval, |
|
|
\DateTimeInterface |
$time |
|
) |
| |
|
protected |
Get a filename to log in.
- Parameters
-
string | $interval | cron interval to log |
\DateTimeInterface | $time | start time of the cron |
- Returns
- string
Definition at line 298 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 202 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 341 of file Cron.php.
Elgg\Cron::rotateLogs |
( |
string |
$interval | ) |
|
|
protected |
Rotate the log files.
- Parameters
-
string | $interval | cron interval |
- Returns
- void
Definition at line 317 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: