Skip to content
Permalink
Browse files
cURL response info
  • Loading branch information
zeleznypa committed Jul 11, 2013
1 parent 066575d commit 0c7fd166908ac6b21d3c73a575979bfa04a9f474
Showing with 25 additions and 0 deletions.
  1. +25 −0 Zeleznypa/Curl/Curl.php
@@ -27,6 +27,9 @@ class Curl extends \Zeleznypa\Curl\SimpleCurl
/** @var string $endpoint */
private $endpoint;

/** @var array $info */
private $info;

/** @var callable $serializeDataFunction */
private $serializeDataFunction;

@@ -188,6 +191,16 @@ public function setEndpoint($endpoint)
return $this;
}

/**
* cURL response info getter
* @author Pavel Železný <info@pavelzelezny.cz>
* @return array
*/
public function getInfo()
{
return $this->info;
}

/**
* Serialize data function setter
* @author Pavel Železný <info@pavelzelezny.cz>
@@ -328,6 +341,18 @@ protected function processOptions()
return $this;
}

/**
* Process cURL response
* @author Pavel Železný <info@pavelzelezny.cz>
* @return \Zeleznypa\Curl\Curl Provides fluent interface
*/
protected function processResponse()
{
parent::processResponse();
$this->info = curl_getinfo($this->getHandler());
return $this;
}

/**
* Serialize POST data
* @author Pavel Železný <info@pavelzelezny.cz>

0 comments on commit 0c7fd16

Please sign in to comment.