Skip to content

Commit

Permalink
Create console.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Nardberjean committed Aug 27, 2017
1 parent f502207 commit 2e72b5a
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions bin/console.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env php
<?php

/*
* This file is part of the Symfony-Util package.
*
* (c) Jean-Bernard Addor
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;

// if you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
// for more information
//umask(0000);

set_time_limit(0);

chdir(dirname($argv[0]));

require '../vendor/autoload.php';
require '../'.getenv('KERNEL_DIR').'/AppKernel.php';

$input = new ArgvInput();
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev');
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod';

if ($debug) {
Debug::enable();
}

$kernel = new AppKernel($env, $debug);
$application = new Application($kernel);
// $application->addCommands( ... );
$application->run($input);

0 comments on commit 2e72b5a

Please sign in to comment.