Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at fix-function-merge 38 lines 1.6 kB view raw
1diff --git a/lib/Configuration.php b/lib/Configuration.php 2index 63f67a3c..f0a53a24 100644 3--- a/lib/Configuration.php 4+++ b/lib/Configuration.php 5@@ -81,8 +81,8 @@ public static function loadConfiguration(array $customConfig = [], array $env = 6 } 7 } 8 9- if (file_exists(__DIR__ . '/../whitelist.txt')) { 10- $enabledBridges = trim(file_get_contents(__DIR__ . '/../whitelist.txt')); 11+ if (file_exists(getenv('RSSBRIDGE_DATA') . '/whitelist.txt')) { 12+ $enabledBridges = trim(file_get_contents(getenv('RSSBRIDGE_DATA') . '/whitelist.txt')); 13 if ($enabledBridges === '*') { 14 self::setConfig('system', 'enabled_bridges', ['*']); 15 } else { 16diff --git a/lib/bootstrap.php b/lib/bootstrap.php 17index 6465f5f9..4605596f 100644 18--- a/lib/bootstrap.php 19+++ b/lib/bootstrap.php 20@@ -1,7 +1,7 @@ 21 <?php 22 23 const PATH_LIB_CACHES = __DIR__ . '/../caches/'; 24-const PATH_CACHE = __DIR__ . '/../cache/'; 25+define('PATH_CACHE', getenv('RSSBRIDGE_DATA') . '/cache/'); 26 27 // Allow larger files for simple_html_dom 28 // todo: extract to config (if possible) 29@@ -43,7 +43,7 @@ 30 }); 31 32 $customConfig = []; 33-if (file_exists(__DIR__ . '/../config.ini.php')) { 34- $customConfig = parse_ini_file(__DIR__ . '/../config.ini.php', true, INI_SCANNER_TYPED); 35+if (file_exists(getenv('RSSBRIDGE_DATA') . '/config.ini.php')) { 36+ $customConfig = parse_ini_file(getenv('RSSBRIDGE_DATA') . '/config.ini.php', true, INI_SCANNER_TYPED); 37 } 38 Configuration::loadConfiguration($customConfig, getenv());