add support for using curl if available

This commit is contained in:
John Bintz 2009-07-15 07:53:39 -04:00
parent 4d7ec077e3
commit fb723778fb
3 changed files with 11 additions and 3 deletions

View File

@ -18,7 +18,15 @@ class PluginWonderful {
* Wrapper around file_get_contents for testing purposes. * Wrapper around file_get_contents for testing purposes.
*/ */
function _retrieve_url($url) { function _retrieve_url($url) {
return @file_get_contents($url); if (extension_loaded('curl')) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
curl_close($ch);
return $result;
} else {
return @file_get_contents($url);
}
} }
function _setup_actions() { function _setup_actions() {

View File

@ -3,7 +3,7 @@
Plugin Name: Plugin Wonderful Plugin Name: Plugin Wonderful
Plugin URI: http://www.coswellproductions.com/wordpress/wordpress-plugins/ Plugin URI: http://www.coswellproductions.com/wordpress/wordpress-plugins/
Description: Easily embed a Project Wonderful publisher's advertisements. Description: Easily embed a Project Wonderful publisher's advertisements.
Version: 0.5.1 Version: 0.5.2
Author: John Bintz Author: John Bintz
Author URI: http://www.coswellproductions.com/wordpress/ Author URI: http://www.coswellproductions.com/wordpress/

View File

@ -3,7 +3,7 @@ Contributors: johncoswell
Tags: ads, sidebar, widget Tags: ads, sidebar, widget
Requires at least: 2.7 Requires at least: 2.7
Tested up to: 2.8 Tested up to: 2.8
Stable tag: 0.5.1 Stable tag: 0.5.2
Donate link: http://www.coswellproductions.com/wordpress/wordpress-plugins/ Donate link: http://www.coswellproductions.com/wordpress/wordpress-plugins/
Plugin Wonderful lets Project Wonderful publishers quickly and easily add their adboxes to thier WordPress site. Plugin Wonderful lets Project Wonderful publishers quickly and easily add their adboxes to thier WordPress site.