Stop using a singleton for Config (#298)

This commit is contained in:
Pierre Rudloff 2020-10-17 22:07:07 +02:00
parent 6fc294afbe
commit 7e2afd8221
14 changed files with 87 additions and 169 deletions

View file

@ -19,10 +19,10 @@ class ConfigFactory
{
$configPath = __DIR__ . '/../config/config.yml';
if (is_file($configPath)) {
Config::setFile($configPath);
$config = Config::fromFile($configPath);
} else {
$config = new Config();
}
$config = Config::getInstance();
if ($config->uglyUrls) {
$container['router'] = new UglyRouter();
}