parent
6951f7796b
commit
7beae0ae05
2 changed files with 12 additions and 11 deletions
|
@ -1,5 +1,6 @@
|
||||||
## v.3.0.1
|
## v.3.0.1
|
||||||
+ Fixed error with older mysql versions.
|
+ Fixed error with older mysql versions.
|
||||||
|
+ Fixed config is compiled with the di container.
|
||||||
+ Small installer update.
|
+ Small installer update.
|
||||||
|
|
||||||
## v.3.0
|
## v.3.0
|
||||||
|
|
|
@ -27,31 +27,30 @@ if (!file_exists('config.php') && is_dir('install/')) {
|
||||||
|
|
||||||
// Load the config
|
// Load the config
|
||||||
$config = array_replace_recursive([
|
$config = array_replace_recursive([
|
||||||
'app_name' => 'XBackBone',
|
'app_name' => 'XBackBone',
|
||||||
'base_url' => isset($_SERVER['HTTPS']) ? 'https://'.$_SERVER['HTTP_HOST'] : 'http://'.$_SERVER['HTTP_HOST'],
|
'base_url' => isset($_SERVER['HTTPS']) ? 'https://'.$_SERVER['HTTP_HOST'] : 'http://'.$_SERVER['HTTP_HOST'],
|
||||||
'debug' => false,
|
'debug' => false,
|
||||||
'maintenance' => false,
|
'maintenance' => false,
|
||||||
'db' => [
|
'db' => [
|
||||||
'connection' => 'sqlite',
|
'connection' => 'sqlite',
|
||||||
'dsn' => BASE_DIR.'resources/database/xbackbone.db',
|
'dsn' => BASE_DIR.'resources/database/xbackbone.db',
|
||||||
'username' => null,
|
'username' => null,
|
||||||
'password' => null,
|
'password' => null,
|
||||||
],
|
],
|
||||||
'storage' => [
|
'storage' => [
|
||||||
'driver' => 'local',
|
'driver' => 'local',
|
||||||
'path' => realpath(__DIR__.'/').DIRECTORY_SEPARATOR.'storage',
|
'path' => realpath(__DIR__.'/').DIRECTORY_SEPARATOR.'storage',
|
||||||
],
|
],
|
||||||
], require BASE_DIR.'config.php');
|
], require BASE_DIR.'config.php');
|
||||||
|
|
||||||
$builder = new ContainerBuilder();
|
$builder = new ContainerBuilder();
|
||||||
|
|
||||||
if (!$config['debug']) {
|
if (!$config['debug']) {
|
||||||
$builder->enableCompilation(BASE_DIR.'/resources/cache/di/');
|
$builder->enableCompilation(BASE_DIR.'/resources/cache/di');
|
||||||
$builder->writeProxiesToFile(true, BASE_DIR.'/resources/cache/proxies');
|
$builder->writeProxiesToFile(true, BASE_DIR.'/resources/cache/di');
|
||||||
}
|
}
|
||||||
|
|
||||||
$builder->addDefinitions([
|
$builder->addDefinitions([
|
||||||
'config' => value($config),
|
|
||||||
View::class => factory(function (Container $container) {
|
View::class => factory(function (Container $container) {
|
||||||
return ViewFactory::createAppInstance($container);
|
return ViewFactory::createAppInstance($container);
|
||||||
}),
|
}),
|
||||||
|
@ -61,6 +60,7 @@ $builder->addDefinitions([
|
||||||
$builder->addDefinitions(__DIR__.'/container.php');
|
$builder->addDefinitions(__DIR__.'/container.php');
|
||||||
|
|
||||||
$app = Bridge::create($builder->build());
|
$app = Bridge::create($builder->build());
|
||||||
|
$app->getContainer()->set('config', $config);
|
||||||
$app->setBasePath(parse_url($config['base_url'], PHP_URL_PATH) ?: '');
|
$app->setBasePath(parse_url($config['base_url'], PHP_URL_PATH) ?: '');
|
||||||
|
|
||||||
if (!$config['debug']) {
|
if (!$config['debug']) {
|
||||||
|
|
Loading…
Reference in a new issue