From bb8900e6c44bcc7872d00db4de3c1b36ce9a5d6e Mon Sep 17 00:00:00 2001 From: momo-i Date: Fri, 30 Jul 2010 00:11:07 +0000 Subject: [PATCH] Check cURL before install. if cURL have not installed, get_like() should be return false. --- lib/class/artist.class.php | 6 ++++++ lib/debug.lib.php | 15 +++++++++++++++ templates/show_install_check.inc.php | 11 +++++++++++ 3 files changed, 32 insertions(+) diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php index e6b5bda9..1009591c 100644 --- a/lib/class/artist.class.php +++ b/lib/class/artist.class.php @@ -146,6 +146,12 @@ class Artist extends database_object { } // get_albums public function get_like() { + + // Are you compiling with cURL? + if (!check_php_curl()) { + return false; + } + $result = array(); $lastfm_api_key = Config::get('lastfm_api_key'); diff --git a/lib/debug.lib.php b/lib/debug.lib.php index 4464447e..e49cb065 100644 --- a/lib/debug.lib.php +++ b/lib/debug.lib.php @@ -156,6 +156,21 @@ function check_php_pcre() { } // check_php_pcre +/** + * check_php_curl + * This makes sure they have cURL (curl_???) support + * compiled into PHP this is optional + */ +function check_php_curl() { + + if (!extension_loaded('curl')) { + return false; + } + + return true; + +} // check_php_curl + /** * check_config_values * checks to make sure that they have at least set the needed variables diff --git a/templates/show_install_check.inc.php b/templates/show_install_check.inc.php index 08952496..97bdb64b 100644 --- a/templates/show_install_check.inc.php +++ b/templates/show_install_check.inc.php @@ -174,5 +174,16 @@ } ?> + +: + +