0
0
Fork 0
mirror of https://github.com/kevinpapst/kimai2.git synced 2025-05-04 17:20:23 +00:00
kevinpapst_kimai2/bin/console

30 lines
793 B
Text
Raw Permalink Normal View History

2016-10-20 22:10:41 +02:00
#!/usr/bin/env php
<?php
2018-01-12 20:39:07 +01:00
use App\Kernel;
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
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');
2016-10-20 22:10:41 +02:00
$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', '']);
2016-10-20 22:10:41 +02:00
if ($debug) {
2018-01-12 20:39:07 +01:00
umask(0000);
Debug::enable();
2016-10-20 22:10:41 +02:00
}
2018-01-12 20:39:07 +01:00
$kernel = new Kernel($env, $debug);
$application = new ConsoleApplication($kernel);
2016-10-20 22:10:41 +02:00
$application->run($input);