Skip to content

Commit 7d8a3d7

Browse files
committed
feature #1119 Bump to Symfony 5.1 and sync recipes (nicolas-grekas)
This PR was merged into the master branch. Discussion ---------- Bump to Symfony 5.1 and sync recipes Quick and untested PR to bump the demo app to SF 5.1 with synced recipes. Feel free to close if this isn't helpful :) Commits ------- ff36ab8 Bump to Symfony 5.1 and sync recipes
2 parents 3a03a8d + ff36ab8 commit 7d8a3d7

22 files changed

+1754
-611
lines changed

.env

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@
1111
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
1212
#
1313
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
14-
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
14+
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
1515

1616
###> symfony/framework-bundle ###
1717
APP_ENV=dev
18-
APP_SECRET=67d829bf61dc5f87a73fd814e2c9f629
18+
APP_SECRET=2ca64f8d83b9e89f5f19d672841d6bb8
1919
#TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
20-
#TRUSTED_HOSTS='^localhost|example\.com$'
20+
#TRUSTED_HOSTS='^(localhost|example\.com)$'
2121
###< symfony/framework-bundle ###
2222

2323
###> doctrine/doctrine-bundle ###
2424
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
25-
# For a MySQL database, use: "mysql://db_user:[email protected]:3306/db_name"
26-
# For a PostgreSQL database, use: "postgresql://db_user:[email protected]:5432/db_name?serverVersion=11"
27-
# Configure your db driver and server_version in config/packages/doctrine.yaml
25+
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
26+
# For a PostgreSQL database, use: "postgresql://db_user:[email protected]:5432/db_name?serverVersion=11&charset=utf8"
27+
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
2828
DATABASE_URL=sqlite:///%kernel.project_dir%/data/database.sqlite
2929
###< doctrine/doctrine-bundle ###
3030

.env.test

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# define your env variables for the test env here
2-
APP_SECRET='$ecretf0rt3st'
3-
DATABASE_URL=sqlite:///%kernel.project_dir%/data/database_test.sqlite
42
KERNEL_CLASS='App\Kernel'
3+
APP_SECRET='$ecretf0rt3st'
54
SYMFONY_DEPRECATIONS_HELPER=999999
5+
PANTHER_APP_ENV=panther
6+
DATABASE_URL=sqlite:///%kernel.project_dir%/data/database_test.sqlite

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
/.env.local
66
/.env.local.php
77
/.env.*.local
8+
/config/secrets/prod/prod.decrypt.private.php
89
/public/bundles/
910
/var/
1011
/vendor/
@@ -22,6 +23,7 @@
2223

2324
###> symfony/webpack-encore-bundle ###
2425
/node_modules/
26+
/public/build/
2527
npm-debug.log
2628
yarn-error.log
2729
###< symfony/webpack-encore-bundle ###

bin/console

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
use App\Kernel;
55
use Symfony\Bundle\FrameworkBundle\Console\Application;
66
use Symfony\Component\Console\Input\ArgvInput;
7+
use Symfony\Component\Dotenv\Dotenv;
78
use Symfony\Component\ErrorHandler\Debug;
89

9-
if (false === 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;
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;
1112
}
1213

1314
set_time_limit(0);
1415

1516
require dirname(__DIR__).'/vendor/autoload.php';
1617

17-
if (!class_exists(Application::class)) {
18-
throw new RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
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.');
1920
}
2021

2122
$input = new ArgvInput();
@@ -27,7 +28,7 @@ if ($input->hasParameterOption('--no-debug', true)) {
2728
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
2829
}
2930

30-
require dirname(__DIR__).'/config/bootstrap.php';
31+
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
3132

3233
if ($_SERVER['APP_DEBUG']) {
3334
umask(0000);

composer.json

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"license": "MIT",
44
"type": "project",
55
"description": "Symfony Demo Application",
6-
"minimum-stability": "stable",
6+
"minimum-stability": "dev",
7+
"prefer-stable": true,
78
"replace": {
89
"symfony/polyfill-php70": "*",
910
"symfony/polyfill-php72": "*"
@@ -17,24 +18,24 @@
1718
"erusev/parsedown": "^1.6",
1819
"sensio/framework-extra-bundle": "^5.1",
1920
"symfony/apache-pack": "^1.0",
20-
"symfony/asset": "5.0.*",
21-
"symfony/console": "5.0.*",
22-
"symfony/dotenv": "5.0.*",
23-
"symfony/expression-language": "5.0.*",
21+
"symfony/asset": "5.1.*",
22+
"symfony/console": "5.1.*",
23+
"symfony/dotenv": "5.1.*",
24+
"symfony/expression-language": "5.1.*",
2425
"symfony/flex": "^1.1",
25-
"symfony/form": "5.0.*",
26-
"symfony/framework-bundle": "5.0.*",
27-
"symfony/intl": "5.0.*",
28-
"symfony/mailer": "5.0.*",
26+
"symfony/form": "5.1.*",
27+
"symfony/framework-bundle": "5.1.*",
28+
"symfony/intl": "5.1.*",
29+
"symfony/mailer": "5.1.*",
2930
"symfony/monolog-bundle": "^3.1",
3031
"symfony/polyfill-intl-messageformatter": "^1.12",
31-
"symfony/security-bundle": "5.0.*",
32-
"symfony/string": "5.0.*",
33-
"symfony/translation": "5.0.*",
32+
"symfony/security-bundle": "5.1.*",
33+
"symfony/string": "5.1.*",
34+
"symfony/translation": "5.1.*",
3435
"symfony/twig-pack": "^1.0",
35-
"symfony/validator": "5.0.*",
36+
"symfony/validator": "5.1.*",
3637
"symfony/webpack-encore-bundle": "^1.4",
37-
"symfony/yaml": "5.0.*",
38+
"symfony/yaml": "5.1.*",
3839
"tgalopin/html-sanitizer-bundle": "^1.2",
3940
"twig/intl-extra": "^3.0",
4041
"twig/markdown-extra": "^3.0"
@@ -43,13 +44,13 @@
4344
"dama/doctrine-test-bundle": "^6.2",
4445
"doctrine/doctrine-fixtures-bundle": "^3.0",
4546
"friendsofphp/php-cs-fixer": "3.0.x-dev",
46-
"symfony/browser-kit": "5.0.*",
47-
"symfony/css-selector": "5.0.*",
48-
"symfony/debug-bundle": "5.0.*",
47+
"symfony/browser-kit": "5.1.*",
48+
"symfony/css-selector": "5.1.*",
49+
"symfony/debug-bundle": "5.1.*",
4950
"symfony/maker-bundle": "^1.11",
50-
"symfony/phpunit-bridge": "5.0.*",
51-
"symfony/stopwatch": "5.0.*",
52-
"symfony/web-profiler-bundle": "5.0.*"
51+
"symfony/phpunit-bridge": "5.1.*",
52+
"symfony/stopwatch": "5.1.*",
53+
"symfony/web-profiler-bundle": "5.1.*"
5354
},
5455
"config": {
5556
"platform": {
@@ -88,7 +89,7 @@
8889
"extra": {
8990
"symfony": {
9091
"allow-contrib": true,
91-
"require": "5.0.*"
92+
"require": "5.1.*"
9293
}
9394
}
9495
}

0 commit comments

Comments
 (0)