1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-07-31 05:40:24 +02:00

Do not use constants for configuration (#2938)

* docs: Do not use constant names when referring to config options

The options are customizable using a config file and no longer hardcoded in index.php since 8ac8e08abf

* Do not use constants for configuration

Since <8ac8e08abf>, they are just set to the configuration object values.
This commit is contained in:
Jan Tojnar
2022-07-24 19:26:12 +02:00
committed by GitHub
parent 499d5c2b77
commit 5b5f3b4254
7 changed files with 15 additions and 23 deletions

View File

@@ -168,28 +168,20 @@ final class Configuration
date_default_timezone_set(self::getConfig('system', 'timezone'));
if (!is_string(self::getConfig('proxy', 'url'))) {
/** URL of the proxy server */
self::reportConfigurationError('proxy', 'url', 'Is not a valid string');
}
if (!empty(self::getConfig('proxy', 'url'))) {
/** URL of the proxy server */
define('PROXY_URL', self::getConfig('proxy', 'url'));
}
/** True if proxy usage can be enabled selectively for each bridge */
if (!is_bool(self::getConfig('proxy', 'by_bridge'))) {
self::reportConfigurationError('proxy', 'by_bridge', 'Is not a valid Boolean');
}
/** True if proxy usage can be enabled selectively for each bridge */
define('PROXY_BYBRIDGE', self::getConfig('proxy', 'by_bridge'));
if (!is_string(self::getConfig('proxy', 'name'))) {
/** Name of the proxy server */
self::reportConfigurationError('proxy', 'name', 'Is not a valid string');
}
/** Name of the proxy server */
define('PROXY_NAME', self::getConfig('proxy', 'name'));
if (!is_string(self::getConfig('cache', 'type'))) {
self::reportConfigurationError('cache', 'type', 'Is not a valid string');
}