diff options
author | purplecode <niespammnie@gmail.com> | 2014-12-24 12:20:42 +0100 |
---|---|---|
committer | purplecode <niespammnie@gmail.com> | 2014-12-24 12:20:42 +0100 |
commit | ffd2008900b34c003e99e09d710586e0435f5af6 (patch) | |
tree | 56be804884177a9e6696d566390eb9c2c6bfb5e7 /src/PurpleCode/PCurl/PCurl.php | |
parent | a3b4c26df66605c76c5893dc1aee2d578b474aed (diff) | |
download | php.curl-ffd2008900b34c003e99e09d710586e0435f5af6.zip php.curl-ffd2008900b34c003e99e09d710586e0435f5af6.tar.gz php.curl-ffd2008900b34c003e99e09d710586e0435f5af6.tar.bz2 |
json, object response changes + test fixes
Diffstat (limited to 'src/PurpleCode/PCurl/PCurl.php')
-rw-r--r-- | src/PurpleCode/PCurl/PCurl.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/PurpleCode/PCurl/PCurl.php b/src/PurpleCode/PCurl/PCurl.php index bd0e5f4..cd442d0 100644 --- a/src/PurpleCode/PCurl/PCurl.php +++ b/src/PurpleCode/PCurl/PCurl.php @@ -104,13 +104,15 @@ class PCurl { throw new PCurlException($error);
}
- $header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
+ $headerSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
+ $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
+
curl_close($curl);
- $header = substr($response, 0, $header_size);
- $body = substr($response, $header_size);
+ $header = substr($response, 0, $headerSize);
+ $body = substr($response, $headerSize);
- return new PCurlResponse($header, $body);
+ return new PCurlResponse($header, $body, $httpCode);
}
/**
@@ -179,6 +181,7 @@ class PCurl { */
public function ignoreSSLCertificate($bool = true) {
$this->setOption(CURLOPT_SSL_VERIFYPEER, !$bool);
+ $this->setOption(CURLOPT_SSL_VERIFYHOST, 0);
return $this;
}
|