first commit
This commit is contained in:
47
bin/console
Normal file
47
bin/console
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
use Symfony\Component\ErrorHandler\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);
|
||||
|
||||
if (!file_exists('./include/config.php') && !file_exists('./config/config.php')) {
|
||||
chdir('/vagrant/home/shop');
|
||||
}
|
||||
|
||||
// Detect new components app - Symfony 6
|
||||
if (file_exists('./config/config.yaml')) {
|
||||
require_once './vendor/autoload_runtime.php';
|
||||
|
||||
return function (array $context): Application {
|
||||
ini_set('memory_limit', '1G');
|
||||
|
||||
$kernel = new \Shop\Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
|
||||
|
||||
return new Application($kernel);
|
||||
};
|
||||
}
|
||||
|
||||
set_time_limit(0);
|
||||
ini_set('memory_limit', '1G');
|
||||
ini_set('output_buffering', 'Off');
|
||||
|
||||
/** @var Composer\Autoload\ClassLoader $loader */
|
||||
$loader = require './app/autoload.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->run($input);
|
||||
Reference in New Issue
Block a user