You are here

abstract class PurgeTarget in Purge 7.2

Abstract Class definition for Purge Targets.

Targets are the destination of the purge requests. Typically a reverse proxy server or an API endpoint.

Hierarchy

Expanded class hierarchy of PurgeTarget

File

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

View source
abstract class PurgeTarget extends Purge implements PurgeValidateable {
  public $urls = array();

  /**
   * Validate
   *
   * @return $errors
   */
  public function validate() {
    $errors = array();

    // Validate the URLs
    foreach ($this->urls as $url) {
      if (!valid_url($url, TRUE)) {
        $url = check_plain($url);
        $errors[] = array(
          'name' => 'urls',
          'message' => t('Target URL @url in target @name is an invalid target URL.', array(
            '@url' => $url,
            '@name' => $this->name,
          )),
        );
      }
    }
    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
PurgeTarget::$urls public property
PurgeTarget::validate public function Validate Overrides Purge::validate