diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CacheFactory.php | 1 | ||||
-rw-r--r-- | lib/Configuration.php | 2 | ||||
-rw-r--r-- | lib/bootstrap.php | 15 | ||||
-rw-r--r-- | lib/logger.php | 1 |
4 files changed, 18 insertions, 1 deletions
diff --git a/lib/CacheFactory.php b/lib/CacheFactory.php index df78d9cb..90aa21ba 100644 --- a/lib/CacheFactory.php +++ b/lib/CacheFactory.php @@ -37,6 +37,7 @@ class CacheFactory if ($index === false) { throw new \InvalidArgumentException(sprintf('Invalid cache name: "%s"', $name)); } + $className = $cacheNames[$index] . 'Cache'; if (!preg_match('/^[A-Z][a-zA-Z0-9-]*$/', $className)) { throw new \InvalidArgumentException(sprintf('Invalid cache classname: "%s"', $className)); diff --git a/lib/Configuration.php b/lib/Configuration.php index ac7d29bf..ab1c9cdf 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -59,7 +59,7 @@ final class Configuration } $config = parse_ini_file(__DIR__ . '/../config.default.ini.php', true, INI_SCANNER_TYPED); if (!$config) { - throw new \Exception('Error parsing config'); + throw new \Exception('Error parsing ini config'); } foreach ($config as $header => $section) { foreach ($section as $key => $value) { diff --git a/lib/bootstrap.php b/lib/bootstrap.php index 85d823e9..fe2069d3 100644 --- a/lib/bootstrap.php +++ b/lib/bootstrap.php @@ -1,5 +1,9 @@ <?php +if (version_compare(\PHP_VERSION, '7.4.0') === -1) { + exit('RSS-Bridge requires minimum PHP version 7.4.0!'); +} + // Path to the formats library const PATH_LIB_FORMATS = __DIR__ . '/../formats/'; @@ -46,3 +50,14 @@ spl_autoload_register(function ($className) { } } }); + +$errors = Configuration::checkInstallation(); +if ($errors) { + exit('<pre>' . implode("\n", $errors) . '</pre>'); +} + +$customConfig = []; +if (file_exists(__DIR__ . '/../config.ini.php')) { + $customConfig = parse_ini_file(__DIR__ . '/../config.ini.php', true, INI_SCANNER_TYPED); +} +Configuration::loadConfiguration($customConfig, getenv()); diff --git a/lib/logger.php b/lib/logger.php index 7a902b5b..e579915d 100644 --- a/lib/logger.php +++ b/lib/logger.php @@ -149,6 +149,7 @@ final class StreamHandler ); error_log($text); if ($record['level'] < Logger::ERROR && Debug::isEnabled()) { + // The record level is INFO or WARNING here // Not a good idea to print here because http headers might not have been sent print sprintf("<pre>%s</pre>\n", e($text)); } |