Skip to content

Commit 456b98e

Browse files
committed
chore: Always catch errors when calling console
1 parent dc5565b commit 456b98e

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

symfony/console/5.3/bin/console

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@ require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
1313
return function (array $context) {
1414
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
1515

16-
return new Application($kernel);
16+
$app = new Application($kernel);
17+
$app->setCatchErrors(true);
18+
19+
return $app;
1720
};

symfony/console/6.4/bin/console

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
use App\Kernel;
5+
use Symfony\Bundle\FrameworkBundle\Console\Application;
6+
7+
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
8+
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
9+
}
10+
11+
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
12+
13+
return function (array $context) {
14+
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
15+
16+
$app = new Application($kernel);
17+
$app->setCatchErrors('prod' === $context['APP_ENV']);
18+
19+
return $app;
20+
};

symfony/console/6.4/manifest.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"copy-from-recipe": {
3+
"bin/": "%BIN_DIR%/"
4+
},
5+
"aliases": ["cli"]
6+
}

0 commit comments

Comments
 (0)