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

Cron. More...

Public Member Functions

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

Protected Attributes

 $default_intervals
 
 $hooks
 
 $events
 

Detailed Description

Cron.

Definition at line 16 of file Cron.php.

Constructor & Destructor Documentation

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

Constructor.

Parameters
PluginHooksService$hooksHooks service
EventsService$eventsEvents service

Definition at line 52 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 173 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 108 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 135 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 241 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 214 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 194 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 66 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 44 of file Cron.php.

Elgg\Cron::$hooks
protected

Definition at line 39 of file Cron.php.


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