purl icon indicating copy to clipboard operation
purl copied to clipboard

curl_getinfo not (yet) supported

Open gerbz opened this issue 11 years ago • 10 comments

1st off - purl is saving my day so TY =)

Im using purl on AppEngine to overcome a few hurdles with API's I use. I'm seeing the warning regarding curl_getinfo but I'm not sure that I'm even using getinfo anywhere? here's the warning:

Warning: curl_getinfo is not (yet) supported by pUrl in /path/to/purl/functions.php on line 117

I just commented out 117 for now - so no biggie.

gerbz avatar Feb 25 '14 01:02 gerbz

Hey, I can add basic support for the function. But I cannot promise to implement support all the curl options for it. Would be nice to know, which (of these http://de3.php.net/manual/en/function.curl-getinfo.php) constants are used by your application.

azayarni avatar Feb 26 '14 17:02 azayarni

I'm not even sure where curl_getinfo was being called from... the error only stated the line in purl.

I was trying to get the CoinBase and WePay php libraries to work on GAE. No luck though =( Had to give in: https://github.com/coinbase/coinbase-php/tree/master/lib https://github.com/wepay/PHP-SDK/blob/master/wepay.php

gerbz avatar Feb 26 '14 18:02 gerbz

Looks like curl_getinfo is used often with OAUTH related libraries. Sofar the only constant I've seen used for curl_getinfo is CURLINFO_HTTP_CODE.

gerbz avatar Feb 26 '14 20:02 gerbz

Ok, it is easy. I'll implement it.

azayarni avatar Feb 26 '14 21:02 azayarni

Great. Although... I've spend all day and failed to get either WePay or CoinBase API's to work. I hardcode the response code so thats not the problem. Both API's respond with an empty body so its impossible to debug whats happening.

Maybe they are expecting the request to come posted using cUrl? I dunno. Very frustrating.

gerbz avatar Feb 26 '14 23:02 gerbz

it seems I have the same issue with google app engine. I try to use opauth with the twitter strategy. It makes 2 times use of curl_getinfo

$c = curl_init(); .... $code = curl_getinfo($c, CURLINFO_HTTP_CODE); $info = curl_getinfo($c);

I'm not sure if this $info variable is used later on

heisenbol avatar Apr 12 '14 14:04 heisenbol

and, yes, purl would save my day, too!

heisenbol avatar Apr 12 '14 14:04 heisenbol

just added basic curl_getinfo() support

azayarni avatar Apr 15 '14 20:04 azayarni

thanks for adding the getinfo support. Unfortunately I get now other errors with my twitter oauth authentication using opauth, which I suspect are due to some deeper differences in how curl works. I'll see if I can make this work

heisenbol avatar Apr 27 '14 07:04 heisenbol

At first I couldn't get purl to work with OpenGraph library on GAE, it turned out getinfo warning and errors that followed were generated from Google/IO/Curl.php file, called by Client.php because it was setup to use curl rather than stream, line 104 of Client.php: if ($config->getIoClass() == Google_Config::USE_AUTO_IO_SELECTION) { if (function_exists('curl_version') && function_exists('curl_exec')) { $config->setIoClass("Google_IO_Curl"); } else { $config->setIoClass("Google_IO_Stream"); } When I set this up to always use $config->setIoClass("Google_IO_Stream") errors were gone and I could finally use opengraph library on GAE.

kr4ft3r avatar Jun 10 '14 16:06 kr4ft3r