Move the console script within a namespace & add a CLI guard

This commit is contained in:
Théo FIDRY
2019-04-07 14:30:04 +02:00
committed by GitHub
parent bddda97f3e
commit 3a51da3273
+6
View File
@@ -1,11 +1,17 @@
#!/usr/bin/env php
<?php
namespace Bin;
use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;
if (false === in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.\PHP_SAPI.' SAPI'.\PHP_EOL;
}
set_time_limit(0);
require dirname(__DIR__).'/vendor/autoload.php';