Skip to content

Commit

Permalink
minor #1165 Updates symfony recipes to latest (mstrom)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
javiereguiluz committed Oct 22, 2020
2 parents 1a397dd + 323c0f1 commit 6501d6e
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 39 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
Expand Down
12 changes: 1 addition & 11 deletions config/packages/framework.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# see https://symfony.com/doc/current/reference/configuration/framework.html
framework:
secret: '%env(APP_SECRET)%'
csrf_protection: true
http_method_override: true
trusted_hosts: null

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

# When using the HTTP Cache, ESI allows to render page fragments separately
# and with different cache configurations for each fragment
# https://symfony.com/doc/current/http_cache/esi.html
esi: true
fragments: true

php_errors:
log: true

# The 'ide' option turns all of the file paths in an exception page
# into clickable links that open the given file using your favorite IDE.
# When 'ide' is set to null the file is opened in your web browser.
# See https://symfony.com/doc/current/reference/configuration/framework.html#ide
ide: null
8 changes: 8 additions & 0 deletions config/packages/prod/deprecations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# As of Symfony 5.1, deprecations are logged in the dedicated "deprecation" channel when it exists
#monolog:
# channels: [deprecation]
# handlers:
# deprecation:
# type: stream
# channels: [deprecation]
# path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"
10 changes: 0 additions & 10 deletions config/packages/prod/monolog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,3 @@ monolog:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine"]

# Uncomment to log deprecations
#deprecation:
# type: stream
# path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"
#deprecation_filter:
# type: filter
# handler: deprecation
# max_level: info
# channels: ["php"]
2 changes: 1 addition & 1 deletion config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ security:
# The name of the route to redirect to after logging out
target: homepage

# Used to restrict access for large sections of your site
# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control:
# this is a catch-all for the admin area
Expand Down
5 changes: 5 additions & 0 deletions config/preload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {
require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
}
10 changes: 7 additions & 3 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ services:
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\:
resource: '../src/*'
exclude: '../src/{DependencyInjection,Entity,Tests,Kernel.php}'
resource: '../src/'
exclude:
- '../src/DependencyInjection/'
- '../src/Entity/'
- '../src/Kernel.php'
- '../src/Tests/'

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

# when the service definition only contains arguments, you can omit the
Expand Down
16 changes: 13 additions & 3 deletions src/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,24 @@ protected function configureContainer(ContainerConfigurator $container): void
{
$container->import('../config/{packages}/*.yaml');
$container->import('../config/{packages}/'.$this->environment.'/*.yaml');
$container->import('../config/{services}.yaml');
$container->import('../config/{services}_'.$this->environment.'.yaml');

if (is_file(\dirname(__DIR__).'/config/services.yaml')) {
$container->import('../config/services.yaml');
$container->import('../config/{services}_'.$this->environment.'.yaml');
} elseif (is_file($path = \dirname(__DIR__).'/config/services.php')) {
(require $path)($container->withPath($path), $this);
}
}

protected function configureRoutes(RoutingConfigurator $routes): void
{
$routes->import('../config/{routes}/'.$this->environment.'/*.yaml');
$routes->import('../config/{routes}/*.yaml');
$routes->import('../config/{routes}.yaml');

if (is_file(\dirname(__DIR__).'/config/routes.yaml')) {
$routes->import('../config/routes.yaml');
} elseif (is_file($path = \dirname(__DIR__).'/config/routes.php')) {
(require $path)($routes->withPath($path), $this);
}
}
}
22 changes: 12 additions & 10 deletions symfony.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,23 @@
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.0",
"ref": "fc52d86631a6dfd9fdf3381d0b7e3df2069e51b3"
"ref": "e5b542d4ef47d8a003c91beb35650c76907f7e53"
},
"files": [
"src/DataFixtures/AppFixtures.php"
]
},
"doctrine/doctrine-migrations-bundle": {
"version": "1.2",
"version": "2.2",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.2",
"ref": "c1431086fec31f17fbcfe6d6d7e92059458facc1"
"version": "2.2",
"ref": "baaa439e3e3179e69e3da84b671f0a3e4a2f56ad"
},
"files": [
"config/packages/doctrine_migrations.yaml",
"src/Migrations/.gitignore"
"migrations/.gitignore"
]
},
"doctrine/event-manager": {
Expand Down Expand Up @@ -285,12 +285,13 @@
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "5.1",
"ref": "37b4ec59eda3eb89705f21a0da7231862495ce0a"
"ref": "6ee1194b036378b21884e7f57b6a2ac721167f16"
},
"files": [
"config/packages/cache.yaml",
"config/packages/framework.yaml",
"config/packages/test/framework.yaml",
"config/preload.php",
"config/routes/dev/framework.yaml",
"config/services.yaml",
"public/index.php",
Expand Down Expand Up @@ -343,10 +344,11 @@
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.3",
"ref": "a89f4cd8a232563707418eea6c2da36acd36a917"
"ref": "d7249f7d560f6736115eee1851d02a65826f0a56"
},
"files": [
"config/packages/dev/monolog.yaml",
"config/packages/prod/deprecations.yaml",
"config/packages/prod/monolog.yaml",
"config/packages/test/monolog.yaml"
]
Expand Down Expand Up @@ -420,12 +422,12 @@
]
},
"symfony/security-bundle": {
"version": "4.4",
"version": "5.1",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "4.4",
"ref": "7b4408dc203049666fe23fabed23cbadc6d8440f"
"version": "5.1",
"ref": "0a4bae19389d3b9cba1ca0102e3b2bccea724603"
},
"files": [
"config/packages/security.yaml"
Expand Down

0 comments on commit 6501d6e

Please sign in to comment.