Skip to content

Commit 3a51da3

Browse files
authored
Move the console script within a namespace & add a CLI guard
1 parent bddda97 commit 3a51da3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

symfony/console/3.3/bin/console

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/usr/bin/env php
22
<?php
33

4+
namespace Bin;
5+
46
use App\Kernel;
57
use Symfony\Bundle\FrameworkBundle\Console\Application;
68
use Symfony\Component\Console\Input\ArgvInput;
79
use Symfony\Component\Debug\Debug;
810

11+
if (false === in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
12+
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.\PHP_SAPI.' SAPI'.\PHP_EOL;
13+
}
14+
915
set_time_limit(0);
1016

1117
require dirname(__DIR__).'/vendor/autoload.php';

0 commit comments

Comments
 (0)