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.
Logged In: NO
What patch, I see no patch!
What patch? I see no patch!
Logged In: YES user_id=341003
Modifications to original toolkit-0.50 sources:
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;
Logged In: YES user_id=961778
Thanks spooker, that will get me going.
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.
Logged In: NO
What patch, I see no patch!
Logged In: NO
What patch? I see no patch!
Logged In: YES
user_id=341003
Modifications to original toolkit-0.50 sources:
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;
Logged In: YES
user_id=961778
Thanks spooker, that will get me going.
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