Skip to content

Support for regular curl instead of curl_multi #49

Closed
iskaler opened this Issue Mar 8, 2010 · 7 comments

5 participants

@iskaler
iskaler commented Mar 8, 2010

I am not able to to twitter search on PHP 5.1 but works on PHP 5.2.

When I var_dump the response the only difference I find is that object(EpiCurl) resource is of type (curl_multi) on PHP 5.2 and object(EpiCurl) resource is of type (curl) when I run it on PHP 5.1

I guess the code support curl_multi and not regular curl

@iskaler
iskaler commented Mar 8, 2010

also even when I try to get remainingHits from twitter the responseText is NULL

@jmathai
Owner
jmathai commented Apr 25, 2010

This is supported in a branch of the ported foursquare library. Just have to merge those changes back into here.

http://github.com/jmathai/foursquare-async/tree/no-multi-curl

@GLStephen

Please do port those changes back. There seems to be some issues with asynchronous calls on Windows. I've tried a hack at merging those changes back into a local copy with not much luck. Granted I only tried a quick hack at it.

I'm hoping someone with a bit more intimate knowledge of the required changes could make that change because it would solve some issues.

@anuj138
anuj138 commented Sep 17, 2010

change following line in EpiOAuth.php (3 times)

$resp = $this->curl->addCurl($ch);
to
$resp = curl_exec($ch);

if you want to get headers and body part from curl:

    $info = curl_getinfo($ch);
    $header = substr($resp, 0, $info['header_size']);
    $body = substr($resp, -$info['download_content_length']);
@GLStephen

anuj,

That gets us close, but I had figured that part out. It seems there is something else that needs to be done simply swapping the async calls for non-async calls does not seem to work.

After those changes I get these errors:

PHP Notice: Trying to get property of non-object in N:\DEV\STEPHEN\includes\twitter\epitwitter\EpiTwitter.php on line 212
PHP Notice: Trying to get property of non-object in N:\DEV\STEPHEN\includes\twitter\epitwitter\EpiTwitter.php on line 213
PHP Notice: Trying to get property of non-object in N:\DEV\STEPHEN\includes\twitter\epitwitter\EpiTwitter.php on line 214
PHP Notice: Trying to get property of non-object in N:\DEV\STEPHEN\includes\twitter\epitwitter\EpiTwitter.php on line 249
PHP Notice: Trying to get property of non-object in N:\DEV\STEPHEN\includes\twitter\epitwitter\EpiTwitter.php on line 251
PHP Notice: Trying to get property of non-object in N:\DEV\STEPHEN\includes\twitter\epitwitter\EpiTwitter.php on line 272
PHP Fatal error: Uncaught exception 'EpiTwitterException' in N:\DEV\STEPHEN\includes\twitter\epitwitter\EpiTwitter.php:272
Stack trace:
#0 N:\DEV\STEPHEN\includes\twitter\epitwitter\EpiTwitter.php(218): EpiTwitterException::raise('{"contributors_...', false)
#1 N:\DEV\STEPHEN\guild\admin\content_options\twitter\index.php(139): EpiTwitterJson->__get('response')
#2 N:\DEV\STEPHEN\guild\admin\content_options\twitter\index.php(112): buildPage()
#3 {main}
thrown in N:\DEV\STEPHEN\includes\twitter\epitwitter\EpiTwitter.php on line 272

@jmathai
Owner
jmathai commented Sep 19, 2010

When in synchronous mode use curl instead of multi curl.
Closed by c365e61

@mrahmadt

Hi

is this supported in the latest version of twitter-async ( no-multi-curl )? I can see some code implemented but not everything

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.