mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-05 16:17:28 +02:00
fix: move debug mode to config (#3324)
* fix: move debug mode to config * fix: also move debug_whitelist to .ini config * fix: move logic back to Debug class * docs * docs * fix: disable debug mode by default * fix: restore previous behavior for alerts * fix: center-align alert text
This commit is contained in:
@@ -114,6 +114,15 @@ final class Configuration
|
||||
}
|
||||
}
|
||||
|
||||
if (file_exists(__DIR__ . '/../DEBUG')) {
|
||||
// The debug mode has been moved to config. Preserve existing installs which has this DEBUG file.
|
||||
self::setConfig('system', 'enable_debug_mode', true);
|
||||
$debug = trim(file_get_contents(__DIR__ . '/../DEBUG'));
|
||||
if ($debug) {
|
||||
self::setConfig('system', 'debug_mode_whitelist', explode("\n", str_replace("\r", '', $debug)));
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
!is_string(self::getConfig('system', 'timezone'))
|
||||
|| !in_array(self::getConfig('system', 'timezone'), timezone_identifiers_list(DateTimeZone::ALL_WITH_BC))
|
||||
@@ -121,6 +130,13 @@ final class Configuration
|
||||
self::throwConfigError('system', 'timezone');
|
||||
}
|
||||
|
||||
if (!is_bool(self::getConfig('system', 'enable_debug_mode'))) {
|
||||
self::throwConfigError('system', 'enable_debug_mode', 'Is not a valid Boolean');
|
||||
}
|
||||
if (!is_array(self::getConfig('system', 'debug_mode_whitelist') ?: [])) {
|
||||
self::throwConfigError('system', 'debug_mode_whitelist', 'Is not a valid array');
|
||||
}
|
||||
|
||||
if (!is_string(self::getConfig('proxy', 'url'))) {
|
||||
self::throwConfigError('proxy', 'url', 'Is not a valid string');
|
||||
}
|
||||
|
Reference in New Issue
Block a user