mirror of
https://github.com/symfony/recipes.git
synced 2026-09-15 00:56:24 +03:00
34 lines
910 B
PHP
Executable File
34 lines
910 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\Debug\Debug;
|
|
use Symfony\Component\Dotenv\Dotenv;
|
|
|
|
umask(0000);
|
|
set_time_limit(0);
|
|
|
|
require __DIR__.'/../vendor/autoload.php';
|
|
|
|
if (!class_exists(Application::class)) {
|
|
throw new \RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
|
|
}
|
|
|
|
if (!isset($_SERVER['APP_ENV'])) {
|
|
(new Dotenv())->load(__DIR__.'/../.env');
|
|
}
|
|
|
|
$input = new ArgvInput();
|
|
$env = $input->getParameterOption(['--env', '-e'], $_SERVER['APP_ENV'] ?? 'dev');
|
|
$debug = ($_SERVER['APP_DEBUG'] ?? true) !== '0' && !$input->hasParameterOption(['--no-debug', '']);
|
|
|
|
if ($debug && class_exists(Debug::class)) {
|
|
Debug::enable();
|
|
}
|
|
|
|
$kernel = new Kernel($env, $debug);
|
|
$application = new Application($kernel);
|
|
$application->run($input);
|