forked from wallabag/wallabag
Load .env file
This commit is contained in:
@ -1,10 +1,16 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Dotenv\Dotenv;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
$kernel = new AppKernel('prod', false);
|
||||
putenv('APP_ENV=' . $_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = 'prod');
|
||||
putenv('APP_DEBUG=' . $_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
|
||||
|
||||
(new Dotenv())->bootEnv(dirname(__DIR__) . '/.env');
|
||||
|
||||
$kernel = new AppKernel($_SERVER['APP_ENV'], (bool )$_SERVER['APP_DEBUG']);
|
||||
//$kernel = new AppCache($kernel);
|
||||
|
||||
// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
|
||||
|
||||
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user