/** * Constructor * * @author Abhinav Kumar * * @param string $_URI default Uri * * @return \SWIFT_HTTPClient */ public function __construct($_URI = null) { parent::__construct(); if (null != $_URI && is_string($_URI)) { $this->_URI = $_URI; } return true; }
public function __construct($_Response) { parent::__construct(); if (!is_string($_Response) || $_Response == '') { throw new SWIFT_Exception(SWIFT_INVALIDDATA); } $this->_RawData = $_Response; $this->ParseRawData($this->_RawData); if ($this->getHeader('Content-Type')) { $this->_responseType = $this->getHeader('Content-Type'); } return true; }
/** * Default constructor. * Checks if the curl extension is loaded * * @throws SWIFT_Exception * @return \SWIFT_HTTPAdapter_Curl */ public function __construct() { parent::__construct(); /** * @todo Propose inclusion of a function to check loaded extension in global functions.php */ if (!in_array('curl', get_loaded_extensions())) { /** * @todo could have been used some SWIFT_HTTPAdapter_CurlException instead */ throw new SWIFT_Exception('Curl Extension ' . SWIFT_CLASSNOTLOADED); } }