示例#1
0
 /**
  * Applies the options to the specified ACurl object.
  * @param ACurl $curl The ACurl object to apply the options to
  */
 public function applyTo(ACurl $curl)
 {
     foreach ($this as $key => $value) {
         $constant = constant($this->getConstantName($key));
         curl_setopt($curl->getHandle(), $constant, $value);
     }
 }
示例#2
0
 /**
  * Returns information about the CURL response.
  * @return CAttributeCollection the curl response details
  */
 public function getInfo()
 {
     if ($this->_info === null) {
         $this->_info = new CAttributeCollection(curl_getinfo($this->request->getHandle()), true);
     }
     return $this->_info;
 }
示例#3
0
 /**
  * Tests performing a http head request for a non existant URL
  * @expectedException ACurlException
  */
 public function testHead404()
 {
     $curl = new ACurl();
     $response = $curl->head("http://uk3.php.net/manual/en/arglebargle")->info;
     $this->assertEquals("text/html;charset=utf-8", $response->content_type);
     $this->assertEquals(404, $response->http_code);
 }