mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-03 16:24:50 +02:00
* refactor * fix: case-sensitive config from env, fix #2935 * lowercase all config section and keys * test: add test for case-insensitivity
This commit is contained in:
@ -20,22 +20,22 @@ class MemcachedCache implements CacheInterface
|
||||
$port = Configuration::getConfig($section, 'port');
|
||||
|
||||
if (empty($host) && empty($port)) {
|
||||
throw new \Exception('Configuration for ' . $section . ' missing. Please check your ' . FILE_CONFIG);
|
||||
throw new \Exception('Configuration for ' . $section . ' missing.');
|
||||
}
|
||||
if (empty($host)) {
|
||||
throw new \Exception('"host" param is not set for ' . $section . '. Please check your ' . FILE_CONFIG);
|
||||
throw new \Exception('"host" param is not set for ' . $section);
|
||||
}
|
||||
if (empty($port)) {
|
||||
throw new \Exception('"port" param is not set for ' . $section . '. Please check your ' . FILE_CONFIG);
|
||||
throw new \Exception('"port" param is not set for ' . $section);
|
||||
}
|
||||
if (!ctype_digit($port)) {
|
||||
throw new \Exception('"port" param is invalid for ' . $section . '. Please check your ' . FILE_CONFIG);
|
||||
throw new \Exception('"port" param is invalid for ' . $section);
|
||||
}
|
||||
|
||||
$port = intval($port);
|
||||
|
||||
if ($port < 1 || $port > 65535) {
|
||||
throw new \Exception('"port" param is invalid for ' . $section . '. Please check your ' . FILE_CONFIG);
|
||||
throw new \Exception('"port" param is invalid for ' . $section);
|
||||
}
|
||||
|
||||
$conn = new \Memcached();
|
||||
|
Reference in New Issue
Block a user