Next major version 2 with PHP 8.1, Symfony 6, Tabler UI, 2FA ... (#2902)
This commit is contained in:
28
bin/console
28
bin/console
@@ -3,27 +3,17 @@
|
||||
|
||||
use App\Kernel;
|
||||
use App\ConsoleApplication;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
use Symfony\Component\ErrorHandler\Debug;
|
||||
use Symfony\Component\Dotenv\Dotenv;
|
||||
|
||||
set_time_limit(0);
|
||||
|
||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||
|
||||
// do NOT rely on calls to getenv() as it is not thread safe
|
||||
(new Dotenv(false))->loadEnv(dirname(__DIR__).'/.env');
|
||||
|
||||
$input = new ArgvInput();
|
||||
$env = $input->getParameterOption(['--env', '-e'], $_SERVER['APP_ENV'] ?? 'prod');
|
||||
$debug = (bool) ($_SERVER['APP_DEBUG'] ?? (in_array($env, ['dev', 'test']))) && !$input->hasParameterOption(['--no-debug', '']);
|
||||
|
||||
if ($debug) {
|
||||
umask(0000);
|
||||
|
||||
Debug::enable();
|
||||
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
|
||||
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
|
||||
}
|
||||
|
||||
$kernel = new Kernel($env, $debug);
|
||||
$application = new ConsoleApplication($kernel);
|
||||
$application->run($input);
|
||||
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
|
||||
|
||||
return function (array $context) {
|
||||
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
|
||||
|
||||
return new ConsoleApplication($kernel);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user