Menu

#1 Update for libCurl usage

open
nobody
None
5
2004-12-01
2004-12-01
No

This patch uses the CURLOPT_RETURNTRANSFER available in
PHP 4.3.8 to return the text from curl_exec() directly
rather than using the output buffering functions.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    What patch, I see no patch!

     
  • Nobody/Anonymous

    Logged In: NO

    What patch? I see no patch!

     
  • Landon Bradshaw

    Landon Bradshaw - 2005-02-25

    Logged In: YES
    user_id=341003

    Modifications to original toolkit-0.50 sources:

     
  • Landon Bradshaw

    Landon Bradshaw - 2005-02-25

    Logged In: YES
    user_id=341003

    Modifications to original toolkit-0.50 sources:
    (I made too many changes to the original files to do a real
    patch so please excuse the hack here)

    includes/config.inc.php
    -$paypal[curl_location]="/usr/local/bin/curl";
    +$paypal['curl_location'] = "/usr/local/bin/curl";
    +$paypal['curl_return'] = true; // can be true if php > 4.3.8

    includes/global_config.inc.php
    -//Start ob to prevent curl_exec from displaying stuff.
    -ob_start();
    -curl_exec($ch);
    -
    -//Get contents of output buffer
    -$info=ob_get_contents();
    -curl_close($ch);
    -
    -//End ob and erase contents.
    -ob_end_clean();
    -
    -return $info;
    + if ($paypal['curl_return']) {
    + curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
    + $info = curl_exec($ch);
    + } else {
    + //Start ob to prevent curl_exec from displaying stuff.
    + ob_start();
    +
    + curl_exec($ch);
    +
    + //Get contents of output buffer
    + $info=ob_get_contents();
    +
    + //End ob and erase contents.
    + ob_end_clean();
    + }
    + curl_close($ch);
    +
    + return $info;

     
  • Chris Miles

    Chris Miles - 2005-02-25

    Logged In: YES
    user_id=961778

    Thanks spooker, that will get me going.

     
  • Landon Bradshaw

    Landon Bradshaw - 2005-02-25

    Logged In: YES
    user_id=341003

    You can also pick up my modified version of the toolkit that
    contains the mysql logging ability at
    http://www.phazeforward.com/paypal-toolkit.tar.gz

     

Log in to post a comment.