This commit is contained in:
2021-03-19 22:48:24 -03:00
parent 4ed9c834eb
commit ec44b0281e
13 changed files with 295 additions and 10945 deletions

View File

@ -44,8 +44,8 @@ $container = $builder->build();
$app = Bridge::create($container);
include_once 'databases.php';
if ($container->has('base_url')) {
$app->setBasePath($container->get('base_url'));
if ($container->has('base_path') and $container->get('base_path') !== null) {
$app->setBasePath($container->get('base_path'));
}
$app->addRoutingMiddleware();

View File

@ -1,7 +1,15 @@
<?php
use Psr\Container\ContainerInterface as Container;
use Dotenv\Dotenv;
if (file_exists(implode(DIRECTORY_SEPARATOR, [dirname(__DIR__, 2), '.env']))) {
$dotenv = Dotenv::createImmutable(dirname(__DIR__, 2));
$dotenv->load();
}
return [
'base_path' => $_ENV['BASE_PATH'] ?? null,
'base_url' => $_ENV['BASE_URL'] ?? null,
'locations' => DI\decorate(function($prev, Container $container) {
$arr = (array) $prev;
$arr['base'] = dirname(__DIR__, 2);