class EasyRdf_Http

Static class to set the HTTP client used by EasyRdf

@package EasyRdf @copyright Copyright (c) 2009-2011 Nicholas J Humfrey @license http://www.opensource.org/licenses/bsd-license.php

Hierarchy

Expanded class hierarchy of EasyRdf_Http

File

drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Http.php, line 47

View source
class EasyRdf_Http {

  /** The default HTTP Client object */
  private static $defaultHttpClient = null;

  /** Set the HTTP Client object used to fetch RDF data
   *
   * @param  object mixed $httpClient The new HTTP client object
   * @return object mixed The new HTTP client object
   */
  public static function setDefaultHttpClient($httpClient) {
    if (!is_object($httpClient) or !($httpClient instanceof Zend_Http_Client or $httpClient instanceof EasyRdf_Http_Client)) {
      throw new InvalidArgumentException("\$httpClient should be an object of class Zend_Http_Client or EasyRdf_Http_Client");
    }
    return self::$defaultHttpClient = $httpClient;
  }

  /** Get the HTTP Client object used to fetch RDF data
   *
   * If no HTTP Client has previously been set, then a new
   * default (EasyRdf_Http_Client) client will be created.
   *
   * @return object mixed The HTTP client object
   */
  public static function getDefaultHttpClient() {
    if (!isset(self::$defaultHttpClient)) {
      self::$defaultHttpClient = new EasyRdf_Http_Client();
    }
    return self::$defaultHttpClient;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EasyRdf_Http::$defaultHttpClient private static property The default HTTP Client object
EasyRdf_Http::getDefaultHttpClient public static function Get the HTTP Client object used to fetch RDF data
EasyRdf_Http::setDefaultHttpClient public static function Set the HTTP Client object used to fetch RDF data