1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-01 17:38:38 +00:00

Load .env file

This commit is contained in:
Yassine Guedidi 2025-02-17 00:16:18 +01:00
parent 2db9ee2ba7
commit ad84d2b13b
6 changed files with 80 additions and 15 deletions

View file

@ -1,5 +1,6 @@
<?php
use Symfony\Component\Dotenv\Dotenv;
use Symfony\Component\ErrorHandler\Debug;
use Symfony\Component\HttpFoundation\Request;
@ -19,9 +20,15 @@ if (isset($_SERVER['HTTP_CLIENT_IP'])
}
require __DIR__.'/../vendor/autoload.php';
putenv('APP_ENV=' . $_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = 'dev');
putenv('APP_DEBUG=' . $_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '1');
(new Dotenv())->bootEnv(dirname(__DIR__) . '/.env');
Debug::enable();
$kernel = new AppKernel('dev', true);
$kernel = new AppKernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();