You are here

class PurgeQueueRunner in Purge 7.2

Use the Queue Runner Queue.

Uses the Queue Runner module to off load purges to a daemon, allowing continues and un-delayed purging.

Hierarchy

Expanded class hierarchy of PurgeQueueRunner

File

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

View source
class PurgeQueueRunner extends PurgeQueue implements PurgeDependable {
  public $queue = array();

  /**
   * Processes the queue.
   */
  public function process() {

    // Create a queuerunner task for each queue item.
    $task = array();
    $task['title'] = 'Purge Task';
    $task['data'] = $this->queue;
    queue_runner_add($task, 'purge_worker_callback');
  }

  /**
   * Validates all depedencies.
   */
  public function validate() {
    $errors = array();
    $pass = $this
      ->check_depend();
    if (!$pass) {
      $dependables = $this
        ->depends();
      foreach ($dependable as $dependable_name => $dependable) {
        if ($dependable['pass'] == 0) {
          $errors[] = array(
            'name' => $dependable_name,
            'message' => $dependable['description'],
          );
        }
      }
    }
    return $errors;
  }

}

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::__sleep public function Only serialize the static values. 1
PurgeQueueRunner::$queue public property
PurgeQueueRunner::process public function Processes the queue.
PurgeQueueRunner::validate public function Validates all depedencies. Overrides Purge::validate