Permalink
Browse files

HTTP response code

  • Loading branch information...
zeleznypa committed Jul 14, 2013
1 parent f45df87 commit ad4983dafec06e3148fb68a6f2840d3ef759eded
Showing with 13 additions and 2 deletions.
  1. +13 −2 Zeleznypa/Curl/Curl.php
@@ -210,11 +210,12 @@ public function getError()
/**
* cURL response info getter
* @author Pavel Železný <info@pavelzelezny.cz>
* @param string $code index of information
* @return array
*/
public function getInfo()
public function getInfo($code = NULL)
{
return $this->info;
return $code === NULL ? $this->info : (isset($this->info[$code]) ? $this->info[$code] : NULL);
}
/**
@@ -346,6 +347,16 @@ public function getRequestOptions()
return $this->getDefaultOptions() + $this->getOptions();
}
/**
* Get cURL response http code
* @author Pavel Železný <info@pavelzelezny.cz>
* @return string
*/
public function getResponseCode()
{
return $this->getInfo('http_code');
}
/**
* Get default cURL options
* @author Pavel Železný <info@pavelzelezny.cz>

0 comments on commit ad4983d

Please sign in to comment.