File "HTTP.php"
Full path: /home/kosmetik/public_html/wp-includes/Requests/Exception/HTTP.php
File
size: 822 B
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Editor Back
<?php
class Requests_Exception_HTTP extends Requests_Exception
{
protected $code = 0;
protected $reason = 'Unknown';
public function __construct($reason = null, $data = null)
{
if ($reason !== null) {
$this->reason = $reason;
}
$message = sprintf('%d %s', $this->code, $this->reason);
parent::__construct($message, 'httpresponse', $data, $this->code);
}
public function getReason()
{
return $this->reason;
}
public static function get_class($code)
{
if (!$code) {
return 'Requests_Exception_HTTP_Unknown';
}
$class = sprintf('Requests_Exception_HTTP_%d', $code);
if (class_exists($class)) {
return $class;
}
return 'Requests_Exception_HTTP_Unknown';
}
}