class Utils

HTTP utility class

Hierarchy

  • class \Guzzle\Http\Utils

Expanded class hierarchy of Utils

1 file declares its use of Utils
Request.php in drupal/core/vendor/guzzle/http/Guzzle/Http/Message/Request.php

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Utils.php, line 11

Namespace

Guzzle\Http
View source
class Utils {

  /**
   * @var string
   */
  protected static $userAgent;

  /**
   * Create an RFC 1123 HTTP-Date from various date values
   *
   * @param string|int $date Date to convert
   *
   * @return string
   */
  public static function getHttpDate($date) {
    if (!is_numeric($date)) {
      $date = strtotime($date);
    }
    return gmdate('D, d M Y H:i:s \\G\\M\\T', $date);
  }

  /**
   * Get the default User-Agent to add to requests sent through the library
   *
   * @return string
   */
  public static function getDefaultUserAgent() {
    if (!self::$userAgent) {
      self::$userAgent = sprintf('Guzzle/%s curl/%s PHP/%s', Version::VERSION, CurlVersion::getInstance()
        ->get('version'), PHP_VERSION);
    }
    return self::$userAgent;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Utils::$userAgent protected static property
Utils::getDefaultUserAgent public static function Get the default User-Agent to add to requests sent through the library
Utils::getHttpDate public static function Create an RFC 1123 HTTP-Date from various date values