浏览代码

Fix console env and debug mode

tags/4.0.15.1
Steevan BARBOYON 8 年前
父节点
当前提交
7e19ae8a2c
共有 1 个文件被更改,包括 2 次插入25 次删除
  1. 2
    25
      bin/console

+ 2
- 25
bin/console 查看文件

@@ -9,32 +9,9 @@ use Symfony\Component\Dotenv\Dotenv;
9 9
 
10 10
 set_time_limit(0);
11 11
 
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';
25 13
 
26 14
 $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);
39 16
 $application = new Application($kernel);
40 17
 $application->run($input);

正在加载...
取消
保存