Create New Item
×
Item Type
File
Folder
Item Name
×
Search file in folder and subfolders...
File Manager
/
wp-includes
/
Requests
/
Exception
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?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'; } }