You are here

class PurgePurgerBundleExample in Purge 7.2

Class definition for the Example Bundle. Provides a set of examples for various uses.

Hierarchy

Expanded class hierarchy of PurgePurgerBundleExample

File

includes/defaults.inc, line 236
Provides default configuration and handlers or the Purge module.

View source
class PurgePurgerBundleExample extends PurgePurgerBundle {

  /**
   * Constructor.
   */
  public function __construct() {

    // Targets
    // The localhost target
    $this->target['localhost'] = new PurgeTargetStatic();
    $this->target['localhost']->name = t('Localhost');
    $this->target['localhost']->description = t('The default localhost ip address.');
    $this->target['localhost']->access = array(
      PURGE_ACCESS_FULL,
    );
    $this->target['localhost']->urls = array(
      'http://127.0.0.1',
    );

    // Domains
    // Get the current domain from the domain object.
    $item_domain_drupal = new PurgeDomainDrupal();
    $item_domain_drupal
      ->cache();
    $this->domain['current_domain'] = new PurgeDomainStatic();
    $this->domain['current_domain']->name = t('Current Domain');
    $this->domain['current_domain']->description = t('Use the current domain as an example domain.');
    $this->domain['current_domain']->domains = $item_domain_drupal->domains[0];

    // Headers
    // Purgers
    // Now create the purger objects
    $this->purger['minimal_purger'] = new PurgePurgerUrl();
    $this->purger['minimal_purger']->name = t('Minimal Purger');
    $this->purger['minimal_purger']->description = t('Uses Drupal native methods to issue the requests.');
    $this->purger['minimal_purger']->item = array(
      'option' => array(
        'method' => 'PURGE',
      ),
      'depend' => array(),
      'target' => array(
        'drupal_url',
      ),
      'header' => array(
        'gzip',
      ),
      'queue' => array(
        'fake',
      ),
      'handler' => array(
        'drupal_http_request',
      ),
    );
    $this->purger['default_purger'] = new PurgePurgerUrl();
    $this->purger['default_purger']->name = t('Default Purger');
    $this->purger['default_purger']->description = t('Uses common settings used for a Varnish setup.');
    $this->purger['default_purger']->item = array(
      'option' => array(
        'method' => 'PURGE',
        'parallel' => 1,
      ),
      'depend' => array(),
      'target' => array(
        'drupal_url',
        'localhost',
      ),
      'domain' => array(
        'drupal_domain',
      ),
      'header' => array(
        'gzip',
      ),
      'queue' => array(
        'fake',
      ),
      'handler' => array(
        'curl',
      ),
    );
  }

}

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.
PurgePurgerBundleExample::__construct public function Constructor.