curl_getinfo
tobciu opened this issue · 5 comments
tobciu commented
please provide the informations as an associative array from curl_getinfo
see: http://php.net/manual/de/function.curl-getinfo.php
-> 'If opt is given, returns its value. Otherwise, returns an associative array with the following elements (which correspond to opt)'
i need 'CURLINFO_REDIRECT_COUNT' for better parsing the response ;-)
linslin commented
Well, here you are. I released Version 1.0.6. https://packagist.org/packages/linslin/yii2-curl
//init curl
$curl = new curl\Curl();
//get http://example.com/
$response = $curl
->setOption(CURLOPT_CONNECTTIMEOUT, 5)
->setOption(CURLOPT_RETURNTRANSFER, true)
->get('http://www.linslin.org/');
var_dump($curl->getInfo()); //return all infos as array
var_dump($curl->getInfo(CURLINFO_REDIRECT_COUNT)); // return info by OPT
tobciu commented
in Line
Line 260 in 39218b5
linslin commented
Thanks, is fixed in 1.0.7. Cheers.
tobciu commented
thank you for your fast response 👍 :-)