refactor: change the way dependencies are wired (#4194)

* refactor: change the way dependencies are setup

* lint
This commit is contained in:
Dag 2024-08-07 03:15:43 +02:00 committed by GitHub
parent 6ec9193546
commit 4faaa79101
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 93 additions and 81 deletions

View file

@ -7,8 +7,21 @@
require __DIR__ . '/../lib/bootstrap.php';
$rssBridge = new RssBridge();
$config = [];
if (file_exists(__DIR__ . '/../config.ini.php')) {
$config = parse_ini_file(__DIR__ . '/../config.ini.php', true, INI_SCANNER_TYPED);
if (!$config) {
http_response_code(500);
exit("Error parsing config.ini.php\n");
}
}
Configuration::loadConfiguration($config, getenv());
$cache = RssBridge::getCache();
$logger = new SimpleLogger('rssbridge');
$logger->addHandler(new StreamHandler('php://stderr', Logger::INFO));
$cacheFactory = new CacheFactory($logger);
$cache = $cacheFactory->create();
$cache->prune();