Skip to content

Commit 2e72b5a

Browse files
authored
Create console.php
1 parent f502207 commit 2e72b5a

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

bin/console.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
/*
5+
* This file is part of the Symfony-Util package.
6+
*
7+
* (c) Jean-Bernard Addor
8+
*
9+
* For the full copyright and license information, please view the LICENSE
10+
* file that was distributed with this source code.
11+
*/
12+
13+
use Symfony\Bundle\FrameworkBundle\Console\Application;
14+
use Symfony\Component\Console\Input\ArgvInput;
15+
use Symfony\Component\Debug\Debug;
16+
17+
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
18+
// read http://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
19+
// for more information
20+
//umask(0000);
21+
22+
set_time_limit(0);
23+
24+
chdir(dirname($argv[0]));
25+
26+
require '../vendor/autoload.php';
27+
require '../'.getenv('KERNEL_DIR').'/AppKernel.php';
28+
29+
$input = new ArgvInput();
30+
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev');
31+
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod';
32+
33+
if ($debug) {
34+
Debug::enable();
35+
}
36+
37+
$kernel = new AppKernel($env, $debug);
38+
$application = new Application($kernel);
39+
// $application->addCommands( ... );
40+
$application->run($input);

0 commit comments

Comments
 (0)