Drupal 8  8.0.2
Cron Class Reference
Inheritance diagram for Cron:

Public Member Functions

 __construct (ModuleHandlerInterface $module_handler, LockBackendInterface $lock, QueueFactory $queue_factory, StateInterface $state, AccountSwitcherInterface $account_switcher, LoggerInterface $logger, QueueWorkerManagerInterface $queue_manager)
 
 run ()
 

Protected Member Functions

 setCronLastTime ()
 
 processQueues ()
 
 invokeCronHandlers ()
 

Protected Attributes

 $moduleHandler
 
 $lock
 
 $queueFactory
 
 $state
 
 $accountSwitcher
 
 $logger
 
 $queueManager
 

Detailed Description

The Drupal core Cron service.

Constructor & Destructor Documentation

__construct ( ModuleHandlerInterface  $module_handler,
LockBackendInterface  $lock,
QueueFactory  $queue_factory,
StateInterface  $state,
AccountSwitcherInterface  $account_switcher,
LoggerInterface  $logger,
QueueWorkerManagerInterface  $queue_manager 
)

Constructs a cron object.

Parameters
\Drupal\Core\Extension\ModuleHandlerInterface$module_handlerThe module handler
\Drupal\Core\Lock\LockBackendInterface$lockThe lock service.
\Drupal\Core\Queue\QueueFactory$queue_factoryThe queue service.
\Drupal\Core\State\StateInterface$stateThe state service.
\Drupal\Core\Session\AccountSwitcherInterface$account_switcherThe account switching service.
\Psr\Log\LoggerInterface$loggerA logger instance.
\Drupal\Core\Queue\QueueWorkerManagerInterfaceThe queue plugin manager.

References Drupal\lock(), Drupal\logger(), Drupal\moduleHandler(), and Drupal\state().

Here is the call graph for this function:

Member Function Documentation

invokeCronHandlers ( )
protected

Invokes any cron handlers implementing hook_cron.

References Drupal\moduleHandler().

Referenced by Cron\run().

Here is the call graph for this function:

Here is the caller graph for this function:

processQueues ( )
protected

Processes cron queues.

Referenced by Cron\run().

Here is the caller graph for this function:

run ( )

{Executes a cron run.Do not call this function from a test. Use $this->cronRun() instead.

Returns
bool TRUE upon success, FALSE otherwise.
}

Implements CronInterface.

References drupal_set_time_limit(), Cron\invokeCronHandlers(), Drupal\lock(), Drupal\logger(), Cron\processQueues(), and Cron\setCronLastTime().

Here is the call graph for this function:

setCronLastTime ( )
protected

Records and logs the request time for this cron invocation.

References Drupal\logger(), and Drupal\state().

Referenced by Cron\run().

Here is the call graph for this function:

Here is the caller graph for this function:


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