lib: Make cURL module requirement optional (#979)
When running in CLI mode without certificates, do not require curl module to be loaded.
This commit is contained in:
parent
e7d3a006c8
commit
4095cad9b4
2 changed files with 3 additions and 2 deletions
|
@ -95,7 +95,8 @@ final class Configuration {
|
||||||
if(!extension_loaded('simplexml'))
|
if(!extension_loaded('simplexml'))
|
||||||
die('"simplexml" extension not loaded. Please check "php.ini"');
|
die('"simplexml" extension not loaded. Please check "php.ini"');
|
||||||
|
|
||||||
if(!extension_loaded('curl'))
|
// Allow RSS-Bridge to run without curl module in CLI mode without root certificates
|
||||||
|
if(!extension_loaded('curl') && !(php_sapi_name() === 'cli' && empty(ini_get('curl.cainfo'))))
|
||||||
die('"curl" extension not loaded. Please check "php.ini"');
|
die('"curl" extension not loaded. Please check "php.ini"');
|
||||||
|
|
||||||
if(!extension_loaded('json'))
|
if(!extension_loaded('json'))
|
||||||
|
|
|
@ -53,7 +53,7 @@ function getContents($url, $header = array(), $opts = array()){
|
||||||
$cache->setParameters($params);
|
$cache->setParameters($params);
|
||||||
|
|
||||||
// Use file_get_contents if in CLI mode with no root certificates defined
|
// Use file_get_contents if in CLI mode with no root certificates defined
|
||||||
if(php_sapi_name() === 'cli' && ini_get('curl.cainfo') === '') {
|
if(php_sapi_name() === 'cli' && empty(ini_get('curl.cainfo'))) {
|
||||||
$data = file_get_contents($url);
|
$data = file_get_contents($url);
|
||||||
|
|
||||||
if($data === false) {
|
if($data === false) {
|
||||||
|
|
Loading…
Reference in a new issue