mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-05 08:07:33 +02:00
config: Use global constant for config files
The configuration files are currently hard-coded in the configuration classes and error messages. However, the implementation should not rely on specific details like the file name. Instead, the files should be part of the global definition. This commit introduces two global constants for the configuration files - FILE_CONFIG => 'config.ini.php' - FILE_CONFIG_DEFAULT => 'config.default.ini.php'
This commit is contained in:
@@ -15,12 +15,12 @@ class SQLiteCache implements CacheInterface {
|
||||
|
||||
$file = Configuration::getConfig(get_called_class(), 'file');
|
||||
if (empty($file)) {
|
||||
die('Configuration for ' . get_called_class() . ' missing. Please check your config.ini.php');
|
||||
die('Configuration for ' . get_called_class() . ' missing. Please check your ' . FILE_CONFIG);
|
||||
}
|
||||
if (dirname($file) == '.') {
|
||||
$file = PATH_CACHE . $file;
|
||||
} elseif (!is_dir(dirname($file))) {
|
||||
die('Invalid configuration for ' . get_called_class() . '. Please check your config.ini.php');
|
||||
die('Invalid configuration for ' . get_called_class() . '. Please check your ' . FILE_CONFIG);
|
||||
}
|
||||
|
||||
if (!is_file($file)) {
|
||||
|
Reference in New Issue
Block a user