summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormomo-i <momo-i@ampache>2010-07-30 00:11:07 +0000
committermomo-i <momo-i@ampache>2010-07-30 00:11:07 +0000
commitbb8900e6c44bcc7872d00db4de3c1b36ce9a5d6e (patch)
treec33f7965f634a0a2d97f9a8f6ed2a82fb9b2e526
parent720dd019a0fa5d529cf41e58dff27a9cc123c5f7 (diff)
downloadampache-bb8900e6c44bcc7872d00db4de3c1b36ce9a5d6e.tar.gz
ampache-bb8900e6c44bcc7872d00db4de3c1b36ce9a5d6e.tar.bz2
ampache-bb8900e6c44bcc7872d00db4de3c1b36ce9a5d6e.zip
Check cURL before install.
if cURL have not installed, get_like() should be return false.
-rw-r--r--lib/class/artist.class.php6
-rw-r--r--lib/debug.lib.php15
-rw-r--r--templates/show_install_check.inc.php11
3 files changed, 32 insertions, 0 deletions
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
@@ -157,6 +157,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 @@
}
?>
</td>
+</tr><tr>
+<td><?php echo _('PHP cURL extension Support'); ?>:</td>
+<td>
+<?php
+ if (!check_php_curl()) {
+ echo debug_result(_('Some functions might not run correctly.'), false);
+ }
+ else {
+ echo debug_result(_(''), true);
+ }
+?>
</tr>
</table>