Skip to content

Commit 3e09653

Browse files
committed
Update to Symfony 5.4
1 parent 2417ac7 commit 3e09653

20 files changed

+1082
-761
lines changed

.env

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@
1515

1616
###> symfony/framework-bundle ###
1717
APP_ENV=prod
18-
#TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
19-
#TRUSTED_HOSTS='^(localhost|example\.com)$'
18+
APP_SECRET=a220b240a991bb80c463dc5ffae0f3b8
2019
###< symfony/framework-bundle ###

.env.local.dist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,4 @@
1515

1616
###> symfony/framework-bundle ###
1717
APP_ENV=dev
18-
#TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
19-
#TRUSTED_HOSTS='^(localhost|example\.com)$'
2018
###< symfony/framework-bundle ###

bin/console

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +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\Dotenv\Dotenv;
8-
use Symfony\Component\ErrorHandler\Debug;
96

10-
if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
11-
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".');
129
}
1310

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

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

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

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
"symfony/flex": "^1.3.1",
1414
"symfony/framework-bundle": "^5.2",
1515
"symfony/mime": "^5.2",
16+
"symfony/monolog-bundle": "^3.7",
17+
"symfony/runtime": "5.4.*",
1618
"symfony/twig-bundle": "^5.2",
1719
"symfony/yaml": "^5.2",
1820
"twig/extra-bundle": "^3",
1921
"twig/twig": "^3"
2022
},
21-
"require-dev": {
22-
},
2323
"config": {
2424
"bin-dir": "bin",
2525
"optimize-autoloader": true,
@@ -32,7 +32,8 @@
3232
"php": "8.0.5"
3333
},
3434
"allow-plugins": {
35-
"symfony/flex": true
35+
"symfony/flex": true,
36+
"symfony/runtime": true
3637
}
3738
},
3839
"autoload": {
@@ -74,7 +75,7 @@
7475
"extra": {
7576
"symfony": {
7677
"allow-contrib": false,
77-
"require": "5.2.*"
78+
"require": "5.4.*"
7879
},
7980
"public-dir": "web"
8081
}

0 commit comments

Comments
 (0)