Skip to content

Commit 6501d6e

Browse files
committed
minor #1165 Updates symfony recipes to latest (mstrom)
This PR was squashed before being merged into the master branch. Discussion ---------- Updates symfony recipes to latest This PR is to update recipes to its latest versions - symfony/framework-bundle - symfony/security-bundle - symfony/monolog-bundle - doctrine/doctrine-fixtures-bundle - doctrine/doctrine-migrations-bundle Commits ------- 323c0f1 Updates symfony recipes to latest
2 parents 1a397dd + 323c0f1 commit 6501d6e

File tree

9 files changed

+49
-39
lines changed

9 files changed

+49
-39
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@
7575
"scripts": {
7676
"auto-scripts": {
7777
"cache:clear": "symfony-cmd",
78-
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
78+
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd",
79+
"assets:install %PUBLIC_DIR%": "symfony-cmd"
7980
},
8081
"post-install-cmd": [
8182
"@auto-scripts"

config/packages/framework.yaml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
# see https://symfony.com/doc/current/reference/configuration/framework.html
12
framework:
23
secret: '%env(APP_SECRET)%'
34
csrf_protection: true
45
http_method_override: true
5-
trusted_hosts: null
66

77
# Enables session support. Note that the session will ONLY be started if you read or write from it.
88
# Remove or comment this section to explicitly disable session support.
@@ -11,17 +11,7 @@ framework:
1111
cookie_secure: auto
1212
cookie_samesite: lax
1313

14-
# When using the HTTP Cache, ESI allows to render page fragments separately
15-
# and with different cache configurations for each fragment
16-
# https://symfony.com/doc/current/http_cache/esi.html
1714
esi: true
1815
fragments: true
19-
2016
php_errors:
2117
log: true
22-
23-
# The 'ide' option turns all of the file paths in an exception page
24-
# into clickable links that open the given file using your favorite IDE.
25-
# When 'ide' is set to null the file is opened in your web browser.
26-
# See https://symfony.com/doc/current/reference/configuration/framework.html#ide
27-
ide: null
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# As of Symfony 5.1, deprecations are logged in the dedicated "deprecation" channel when it exists
2+
#monolog:
3+
# channels: [deprecation]
4+
# handlers:
5+
# deprecation:
6+
# type: stream
7+
# channels: [deprecation]
8+
# path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"

config/packages/prod/monolog.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,3 @@ monolog:
1414
type: console
1515
process_psr_3_messages: false
1616
channels: ["!event", "!doctrine"]
17-
18-
# Uncomment to log deprecations
19-
#deprecation:
20-
# type: stream
21-
# path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"
22-
#deprecation_filter:
23-
# type: filter
24-
# handler: deprecation
25-
# max_level: info
26-
# channels: ["php"]

config/packages/security.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ security:
5252
# The name of the route to redirect to after logging out
5353
target: homepage
5454

55-
# Used to restrict access for large sections of your site
55+
# Easy way to control access for large sections of your site
5656
# Note: Only the *first* access control that matches will be used
5757
access_control:
5858
# this is a catch-all for the admin area

config/preload.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {
4+
require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
5+
}

config/services.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@ services:
2222
# makes classes in src/ available to be used as services
2323
# this creates a service per class whose id is the fully-qualified class name
2424
App\:
25-
resource: '../src/*'
26-
exclude: '../src/{DependencyInjection,Entity,Tests,Kernel.php}'
25+
resource: '../src/'
26+
exclude:
27+
- '../src/DependencyInjection/'
28+
- '../src/Entity/'
29+
- '../src/Kernel.php'
30+
- '../src/Tests/'
2731

2832
# controllers are imported separately to make sure services can be injected
2933
# as action arguments even if you don't extend any base controller class
3034
App\Controller\:
31-
resource: '../src/Controller'
35+
resource: '../src/Controller/'
3236
tags: ['controller.service_arguments']
3337

3438
# when the service definition only contains arguments, you can omit the

src/Kernel.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,24 @@ protected function configureContainer(ContainerConfigurator $container): void
2424
{
2525
$container->import('../config/{packages}/*.yaml');
2626
$container->import('../config/{packages}/'.$this->environment.'/*.yaml');
27-
$container->import('../config/{services}.yaml');
28-
$container->import('../config/{services}_'.$this->environment.'.yaml');
27+
28+
if (is_file(\dirname(__DIR__).'/config/services.yaml')) {
29+
$container->import('../config/services.yaml');
30+
$container->import('../config/{services}_'.$this->environment.'.yaml');
31+
} elseif (is_file($path = \dirname(__DIR__).'/config/services.php')) {
32+
(require $path)($container->withPath($path), $this);
33+
}
2934
}
3035

3136
protected function configureRoutes(RoutingConfigurator $routes): void
3237
{
3338
$routes->import('../config/{routes}/'.$this->environment.'/*.yaml');
3439
$routes->import('../config/{routes}/*.yaml');
35-
$routes->import('../config/{routes}.yaml');
40+
41+
if (is_file(\dirname(__DIR__).'/config/routes.yaml')) {
42+
$routes->import('../config/routes.yaml');
43+
} elseif (is_file($path = \dirname(__DIR__).'/config/routes.php')) {
44+
(require $path)($routes->withPath($path), $this);
45+
}
3646
}
3747
}

symfony.lock

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,23 @@
6868
"repo": "github.com/symfony/recipes",
6969
"branch": "master",
7070
"version": "3.0",
71-
"ref": "fc52d86631a6dfd9fdf3381d0b7e3df2069e51b3"
71+
"ref": "e5b542d4ef47d8a003c91beb35650c76907f7e53"
7272
},
7373
"files": [
7474
"src/DataFixtures/AppFixtures.php"
7575
]
7676
},
7777
"doctrine/doctrine-migrations-bundle": {
78-
"version": "1.2",
78+
"version": "2.2",
7979
"recipe": {
8080
"repo": "github.com/symfony/recipes",
8181
"branch": "master",
82-
"version": "1.2",
83-
"ref": "c1431086fec31f17fbcfe6d6d7e92059458facc1"
82+
"version": "2.2",
83+
"ref": "baaa439e3e3179e69e3da84b671f0a3e4a2f56ad"
8484
},
8585
"files": [
8686
"config/packages/doctrine_migrations.yaml",
87-
"src/Migrations/.gitignore"
87+
"migrations/.gitignore"
8888
]
8989
},
9090
"doctrine/event-manager": {
@@ -285,12 +285,13 @@
285285
"repo": "github.com/symfony/recipes",
286286
"branch": "master",
287287
"version": "5.1",
288-
"ref": "37b4ec59eda3eb89705f21a0da7231862495ce0a"
288+
"ref": "6ee1194b036378b21884e7f57b6a2ac721167f16"
289289
},
290290
"files": [
291291
"config/packages/cache.yaml",
292292
"config/packages/framework.yaml",
293293
"config/packages/test/framework.yaml",
294+
"config/preload.php",
294295
"config/routes/dev/framework.yaml",
295296
"config/services.yaml",
296297
"public/index.php",
@@ -343,10 +344,11 @@
343344
"repo": "github.com/symfony/recipes",
344345
"branch": "master",
345346
"version": "3.3",
346-
"ref": "a89f4cd8a232563707418eea6c2da36acd36a917"
347+
"ref": "d7249f7d560f6736115eee1851d02a65826f0a56"
347348
},
348349
"files": [
349350
"config/packages/dev/monolog.yaml",
351+
"config/packages/prod/deprecations.yaml",
350352
"config/packages/prod/monolog.yaml",
351353
"config/packages/test/monolog.yaml"
352354
]
@@ -420,12 +422,12 @@
420422
]
421423
},
422424
"symfony/security-bundle": {
423-
"version": "4.4",
425+
"version": "5.1",
424426
"recipe": {
425427
"repo": "github.com/symfony/recipes",
426428
"branch": "master",
427-
"version": "4.4",
428-
"ref": "7b4408dc203049666fe23fabed23cbadc6d8440f"
429+
"version": "5.1",
430+
"ref": "0a4bae19389d3b9cba1ca0102e3b2bccea724603"
429431
},
430432
"files": [
431433
"config/packages/security.yaml"

0 commit comments

Comments
 (0)