Skip to content

Commit 7e19ae8

Browse files
committed
Fix console env and debug mode
1 parent 24d4d6f commit 7e19ae8

File tree

1 file changed

+2
-25
lines changed

1 file changed

+2
-25
lines changed

bin/console

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,9 @@ use Symfony\Component\Dotenv\Dotenv;
99

1010
set_time_limit(0);
1111

12-
require __DIR__.'/../vendor/autoload.php';
13-
14-
if (!class_exists(Application::class)) {
15-
throw new \RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
16-
}
17-
18-
$_SERVER['APP_ENV']='helloworld';
19-
if (!isset($_SERVER['APP_ENV'])) {
20-
if (!class_exists(Dotenv::class)) {
21-
throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
22-
}
23-
(new Dotenv())->load(__DIR__.'/../.env');
24-
}
12+
require __DIR__ . '/../vendor/autoload.php';
2513

2614
$input = new ArgvInput();
27-
$env = $input->getParameterOption(['--env', '-e'], $_SERVER['APP_ENV'] ?? 'dev');
28-
$debug = ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env)) && !$input->hasParameterOption(['--no-debug', '']);
29-
30-
if ($debug) {
31-
umask(0000);
32-
33-
if (class_exists(Debug::class)) {
34-
Debug::enable();
35-
}
36-
}
37-
38-
$kernel = new Kernel($env, $debug);
15+
$kernel = new Kernel('prod', false);
3916
$application = new Application($kernel);
4017
$application->run($input);

0 commit comments

Comments
 (0)