You are here

class PurgePurgerBundleQueue in Purge 7.2

Executes queued purges.

This is a minimal bundle, containing just the handlers needed to process all queued purges.

Hierarchy

Expanded class hierarchy of PurgePurgerBundleQueue

File

includes/purge.class.inc, line 1017
Contains all class and interface definitions for Purge.

View source
class PurgePurgerBundleQueue extends PurgePurgerBundle {

  /**
   * Constructs the bundle from queue items and executes the purges.
   *
   * @param array $queue_items
   */
  public function __construct($queue_items) {

    // Get the raw data from the variable (or cache at a later stage).
    $all_data = $this
      ->get_data();

    // Figure out which handlers we'll need for these purges.
    foreach ($queue_items as $queue_item) {
      $handler_name = $queue_item['handler'];
      if (!isset($this->handler[$handler_name])) {

        // Create the object from the serialized data.
        $this->handler[$handler_name] = unserialize($all_data['handler'][$handler_name]);
      }
    }
  }

  /**
   * Executes all queueditems with their handlers.
   */
  public function execute($queue_items) {

    // Execute all queue items to the handlers.
    foreach ($queue_items as $queue_item) {
      $handler_name = $queue_item['handler'];
      $this->handler[$handler_name]
        ->execute($queue_item['purges'], $queue_item['handler_options']);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Purge::$access public property
Purge::$available public property
Purge::$depend public property
Purge::$description public property
Purge::$enabled public property
Purge::$item public property
Purge::$name public property
Purge::$option public property
Purge::validate public function Does basic dependency checks for builtin dependencies. 5
PurgePurger::$domain public property
PurgePurger::$handler public property
PurgePurger::$header public property
PurgePurger::$queue public property
PurgePurger::$target public property
PurgePurgerBundle::$type public property
PurgePurgerBundle::get_data public function Function to select data from the dataset.
PurgePurgerBundle::set_types public function Function to set the type objects.
PurgePurgerBundle::__sleep public function Override for parents sleep to make sure we include the bundled objects. Overrides Purge::__sleep
PurgePurgerBundle::__wakeup public function Set the item objects linked in this bundle when waking up.
PurgePurgerBundleQueue::execute public function Executes all queueditems with their handlers.
PurgePurgerBundleQueue::__construct public function Constructs the bundle from queue items and executes the purges.