1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-05 02:39:47 +02:00

Check cURL before install.

if cURL have not installed, get_like() should be return false.
This commit is contained in:
momo-i 2010-07-30 00:11:07 +00:00
parent 720dd019a0
commit bb8900e6c4
3 changed files with 32 additions and 0 deletions

View file

@ -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');

View file

@ -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

View file

@ -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>