Skip to content

Commit 4bcf36b

Browse files
committed
Update symfony/console recipe
1 parent ffb4c85 commit 4bcf36b

File tree

2 files changed

+12
-38
lines changed

2 files changed

+12
-38
lines changed

bin/console

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,15 @@
33

44
use App\Kernel;
55
use Symfony\Bundle\FrameworkBundle\Console\Application;
6-
use Symfony\Component\Console\Input\ArgvInput;
7-
use Symfony\Component\ErrorHandler\Debug;
86

9-
if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
10-
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL;
7+
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
8+
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
119
}
1210

13-
set_time_limit(0);
11+
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
1412

15-
require dirname(__DIR__).'/vendor/autoload.php';
13+
return function (array $context) {
14+
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
1615

17-
if (!class_exists(Application::class)) {
18-
throw new LogicException('You need to add "symfony/framework-bundle" as a Composer dependency.');
19-
}
20-
21-
$input = new ArgvInput();
22-
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
23-
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
24-
}
25-
26-
if ($input->hasParameterOption('--no-debug', true)) {
27-
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
28-
}
29-
30-
require dirname(__DIR__).'/config/bootstrap.php';
31-
32-
if ($_SERVER['APP_DEBUG']) {
33-
umask(0000);
34-
35-
if (class_exists(Debug::class)) {
36-
Debug::enable();
37-
}
38-
}
39-
40-
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
41-
$application = new Application($kernel);
42-
$application->run($input);
16+
return new Application($kernel);
17+
};

symfony.lock

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
"repo": "github.com/symfony/recipes-contrib",
123123
"branch": "master",
124124
"version": "1.0",
125-
"ref": "71599f5b0fdeeeec0fb90e9b17c85e6f5e1350c1"
125+
"ref": "9d254a22efca7264203eea98b866f16f944b2f09"
126126
},
127127
"files": [
128128
"public/.htaccess"
@@ -141,16 +141,15 @@
141141
"version": "v4.4.16"
142142
},
143143
"symfony/console": {
144-
"version": "4.4",
144+
"version": "5.3",
145145
"recipe": {
146146
"repo": "github.com/symfony/recipes",
147147
"branch": "master",
148-
"version": "4.4",
149-
"ref": "ea8c0eda34fda57e7d5cd8cbd889e2a387e3472c"
148+
"version": "5.3",
149+
"ref": "da0c8be8157600ad34f10ff0c9cc91232522e047"
150150
},
151151
"files": [
152-
"bin/console",
153-
"config/bootstrap.php"
152+
"bin/console"
154153
]
155154
},
156155
"symfony/debug": {

0 commit comments

Comments
 (0)