Fixed config wrong compilation

Fixes #112
Fixes #111
This commit is contained in:
Sergio Brighenti 2019-11-25 23:37:12 +01:00
parent 6951f7796b
commit 7beae0ae05
2 changed files with 12 additions and 11 deletions

View file

@ -1,5 +1,6 @@
## v.3.0.1
+ Fixed error with older mysql versions.
+ Fixed config is compiled with the di container.
+ Small installer update.
## v.3.0

View file

@ -46,12 +46,11 @@ $config = array_replace_recursive([
$builder = new ContainerBuilder();
if (!$config['debug']) {
$builder->enableCompilation(BASE_DIR.'/resources/cache/di/');
$builder->writeProxiesToFile(true, BASE_DIR.'/resources/cache/proxies');
$builder->enableCompilation(BASE_DIR.'/resources/cache/di');
$builder->writeProxiesToFile(true, BASE_DIR.'/resources/cache/di');
}
$builder->addDefinitions([
'config' => value($config),
View::class => factory(function (Container $container) {
return ViewFactory::createAppInstance($container);
}),
@ -61,6 +60,7 @@ $builder->addDefinitions([
$builder->addDefinitions(__DIR__.'/container.php');
$app = Bridge::create($builder->build());
$app->getContainer()->set('config', $config);
$app->setBasePath(parse_url($config['base_url'], PHP_URL_PATH) ?: '');
if (!$config['debug']) {