0
0
Fork 0
mirror of https://github.com/kevinpapst/kimai2.git synced 2025-03-20 07:33:01 +00:00
kevinpapst_kimai2/bin/console
2020-08-02 01:02:04 +02:00

29 lines
814 B
PHP
Executable file

#!/usr/bin/env php
<?php
use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
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();
}
$kernel = new Kernel($env, $debug);
$application = new Application($kernel);
$application->run($input);