2016-10-20 22:10:41 +02:00
|
|
|
#!/usr/bin/env php
|
|
|
|
<?php
|
|
|
|
|
2018-01-12 20:39:07 +01:00
|
|
|
use App\Kernel;
|
2020-12-10 16:25:14 +01:00
|
|
|
use App\ConsoleApplication;
|
2016-10-20 22:10:41 +02:00
|
|
|
use Symfony\Component\Console\Input\ArgvInput;
|
2020-02-04 15:29:26 +01:00
|
|
|
use Symfony\Component\ErrorHandler\Debug;
|
2018-01-12 20:39:07 +01:00
|
|
|
use Symfony\Component\Dotenv\Dotenv;
|
2016-10-20 22:10:41 +02:00
|
|
|
|
2020-06-11 01:26:57 +02:00
|
|
|
set_time_limit(0);
|
|
|
|
|
2020-08-02 01:02:04 +02:00
|
|
|
require dirname(__DIR__) . '/vendor/autoload.php';
|
2020-06-11 01:26:57 +02:00
|
|
|
|
2020-08-02 01:02:04 +02:00
|
|
|
// do NOT rely on calls to getenv() as it is not thread safe
|
|
|
|
(new Dotenv(false))->loadEnv(dirname(__DIR__).'/.env');
|
2016-10-20 22:10:41 +02:00
|
|
|
|
|
|
|
$input = new ArgvInput();
|
2020-06-11 01:26:57 +02:00
|
|
|
$env = $input->getParameterOption(['--env', '-e'], $_SERVER['APP_ENV'] ?? 'prod');
|
|
|
|
$debug = (bool) ($_SERVER['APP_DEBUG'] ?? (in_array($env, ['dev', 'test']))) && !$input->hasParameterOption(['--no-debug', '']);
|
2016-10-20 22:10:41 +02:00
|
|
|
|
|
|
|
if ($debug) {
|
2018-01-12 20:39:07 +01:00
|
|
|
umask(0000);
|
|
|
|
|
2020-08-02 01:02:04 +02:00
|
|
|
Debug::enable();
|
2016-10-20 22:10:41 +02:00
|
|
|
}
|
|
|
|
|
2018-01-12 20:39:07 +01:00
|
|
|
$kernel = new Kernel($env, $debug);
|
2020-12-10 16:25:14 +01:00
|
|
|
$application = new ConsoleApplication($kernel);
|
2016-10-20 22:10:41 +02:00
|
|
|
$application->run($input);
|