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

Cron. More...

Public Member Functions

 __construct (PluginHooksService $hooks, Logger $logger, 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...
 

Static Public Attributes

static $intervals
 

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...
 
 log ($setting, $interval, $msg= '')
 Log the results of a cron interval. More...
 

Protected Attributes

 $hooks
 
 $events
 

Detailed Description

Cron.

Definition at line 14 of file Cron.php.

Constructor & Destructor Documentation

Elgg\Cron::__construct ( PluginHooksService  $hooks,
Logger  $logger,
EventsService  $events 
)

Constructor.

Parameters
PluginHooksService$hooksHooks service
Logger$loggerLogger
EventsService$eventsEvents service

Definition at line 48 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 169 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 104 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 131 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 210 of file Cron.php.

Elgg\Cron::log (   $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 190 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

Definition at line 63 of file Cron.php.

Member Data Documentation

Elgg\Cron::$events
protected

Definition at line 39 of file Cron.php.

Elgg\Cron::$hooks
protected

Definition at line 34 of file Cron.php.

Elgg\Cron::$intervals
static
Initial value:
= [
'minute' => '* * * * *'

Definition at line 19 of file Cron.php.


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