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:
parent
720dd019a0
commit
bb8900e6c4
3 changed files with 32 additions and 0 deletions
|
@ -146,6 +146,12 @@ class Artist extends database_object {
|
||||||
|
|
||||||
} // get_albums
|
} // get_albums
|
||||||
public function get_like() {
|
public function get_like() {
|
||||||
|
|
||||||
|
// Are you compiling with cURL?
|
||||||
|
if (!check_php_curl()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$result = array();
|
$result = array();
|
||||||
$lastfm_api_key = Config::get('lastfm_api_key');
|
$lastfm_api_key = Config::get('lastfm_api_key');
|
||||||
|
|
||||||
|
|
|
@ -156,6 +156,21 @@ function check_php_pcre() {
|
||||||
|
|
||||||
} // 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
|
* check_config_values
|
||||||
* checks to make sure that they have at least set the needed variables
|
* checks to make sure that they have at least set the needed variables
|
||||||
|
|
|
@ -174,5 +174,16 @@
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</td>
|
</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>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue