Elgg  Version 5.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Elgg\Cron Class Reference

Cron. More...

Public Member Functions

 __construct (EventsService $events)
 Constructor. More...
 
 run (array $intervals=null, $force=false)
 Executes handlers for periods that have elapsed since last cron. More...
 
 getLog ($setting, $interval)
 Get the log contents of a cron interval. More...
 
 getConfiguredIntervals (bool $only_names=false)
 Get the cron interval configuration. More...
 

Protected Member Functions

 before ($interval,\DateTime $time=null)
 Execute commands before cron interval is run. More...
 
 execute ($interval,\DateTime $time=null)
 Execute handlers attached to a specific cron interval. More...
 
 after ($output, $interval)
 Printers handler result. More...
 
 cronLog ($setting, $interval, $msg= '')
 Log the results of a cron interval. More...
 

Protected Attributes

 $default_intervals
 
 $events
 

Detailed Description

Cron.

Definition at line 16 of file Cron.php.

Constructor & Destructor Documentation

Elgg\Cron::__construct ( EventsService  $events)

Constructor.

Parameters
EventsService$eventsEvents service

Definition at line 46 of file Cron.php.

Member Function Documentation

Elgg\Cron::after (   $output,
  $interval 
)
protected

Printers handler result.

Parameters
string$outputOutput string
string$intervalInterval name
Returns
void

Definition at line 166 of file Cron.php.

Elgg\Cron::before (   $interval,
\DateTime  $time = null 
)
protected

Execute commands before cron interval is run.

Parameters
string$intervalInterval name
\DateTime$timeTime of the cron initialization
Returns
void

Definition at line 101 of file Cron.php.

Elgg\Cron::cronLog (   $setting,
  $interval,
  $msg = '' 
)
protected

Log the results of a cron interval.

Parameters
string$setting'output'|'completion'
string$intervalInterval name
string$msgLogged message
Returns
void

Definition at line 187 of file Cron.php.

Elgg\Cron::execute (   $interval,
\DateTime  $time = null 
)
protected

Execute handlers attached to a specific cron interval.

Parameters
string$intervalCron interval to execute
\DateTime$timeTime of cron initialization
Returns
string

Definition at line 128 of file Cron.php.

Elgg\Cron::getConfiguredIntervals ( bool  $only_names = false)

Get the cron interval configuration.

Parameters
bool$only_namesOnly return the names of the intervals
Returns
array
Since
3.2

Definition at line 234 of file Cron.php.

Elgg\Cron::getLog (   $setting,
  $interval 
)

Get the log contents of a cron interval.

Parameters
string$setting'output'|'completion'
string$intervalInterval name
Returns
string

Definition at line 207 of file Cron.php.

Elgg\Cron::run ( array  $intervals = null,
  $force = false 
)

Executes handlers for periods that have elapsed since last cron.

Parameters
array$intervalsInterval names to run
bool$forceForce cron jobs to run even they are not yet due
Returns
Job[]
Exceptions
CronException

Definition at line 59 of file Cron.php.

Member Data Documentation

Elgg\Cron::$default_intervals
protected
Initial value:
= [
'minute' => '* * * * *'

Definition at line 24 of file Cron.php.

Elgg\Cron::$events
protected

Definition at line 39 of file Cron.php.


The documentation for this class was generated from the following file: