You are here

class AcquiaPurgeProcessorCron in Acquia Purge 7

Processes the queue during hook_cron().

Hierarchy

Expanded class hierarchy of AcquiaPurgeProcessorCron

File

lib/processor/AcquiaPurgeProcessorCron.php, line 11
Contains AcquiaPurgeProcessorCron.

View source
class AcquiaPurgeProcessorCron extends AcquiaPurgeProcessorBase implements AcquiaPurgeProcessorInterface {

  /**
   * {@inheritdoc}
   */
  public static function isEnabled() {

    // Don't load AcquiaPurgeProcessorCron when AcquiaPurgeProcessorRuntime is
    // enabled as well, since this can lead to double processing during cron.
    // Although running AcquiaPurgeService::process() twice during the same
    // request won't harm because of the built-in capacity calculation, it would
    // mean that the second run won't purge anything as the former already did.
    // See Drupal.org issue #2292773.
    if (_acquia_purge_variable('acquia_purge_lateruntime')) {
      return FALSE;
    }
    return (bool) _acquia_purge_variable('acquia_purge_cron');
  }

  /**
   * {@inheritdoc}
   */
  public function getSubscribedEvents() {
    return array(
      'onCron',
    );
  }

  /**
   * Implements event onCron.
   *
   * @see acquia_purge_cron()
   */
  public function onCron() {
    $this
      ->processQueueChunk();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AcquiaPurgeProcessorBase::$service protected property The Acquia Purge service object.
AcquiaPurgeProcessorBase::processQueueChunk protected function Attempt to process a chunk from the queue. 1
AcquiaPurgeProcessorBase::__construct public function Construct a new AcquiaPurgeProcessorBase instance. 2
AcquiaPurgeProcessorCron::getSubscribedEvents public function Subscribe to the events this processor requires. Overrides AcquiaPurgeProcessorInterface::getSubscribedEvents
AcquiaPurgeProcessorCron::isEnabled public static function Determine if the processor is enabled or not. Overrides AcquiaPurgeProcessorInterface::isEnabled
AcquiaPurgeProcessorCron::onCron public function Implements event onCron.