From 6a56bc2c3612a6ae870c82f22679637f24b32ada Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:20:22 +0100 Subject: [PATCH] feat(update): apply recipes:update symfony/framework-bundle --- config/packages/framework.yaml | 9 ++++++++- config/packages/test/framework.yaml | 4 ---- config/routes/dev/framework.yaml | 3 --- config/routes/framework.yaml | 4 ++++ config/services.yaml | 2 +- public/index.php | 21 ++++----------------- src/Kernel.php | 27 --------------------------- symfony.lock | 11 +++++------ 8 files changed, 22 insertions(+), 59 deletions(-) delete mode 100644 config/packages/test/framework.yaml delete mode 100644 config/routes/dev/framework.yaml create mode 100644 config/routes/framework.yaml diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml index cad7f78..7853e9e 100644 --- a/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -2,7 +2,7 @@ framework: secret: '%env(APP_SECRET)%' #csrf_protection: true - #http_method_override: true + http_method_override: false # 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. @@ -10,8 +10,15 @@ framework: handler_id: null cookie_secure: auto cookie_samesite: lax + storage_factory_id: session.storage.factory.native #esi: true #fragments: true php_errors: log: true + +when@test: + framework: + test: true + session: + storage_factory_id: session.storage.factory.mock_file diff --git a/config/packages/test/framework.yaml b/config/packages/test/framework.yaml deleted file mode 100644 index d051c84..0000000 --- a/config/packages/test/framework.yaml +++ /dev/null @@ -1,4 +0,0 @@ -framework: - test: true - session: - storage_id: session.storage.mock_file diff --git a/config/routes/dev/framework.yaml b/config/routes/dev/framework.yaml deleted file mode 100644 index bcbbf13..0000000 --- a/config/routes/dev/framework.yaml +++ /dev/null @@ -1,3 +0,0 @@ -_errors: - resource: '@FrameworkBundle/Resources/config/routing/errors.xml' - prefix: /_error diff --git a/config/routes/framework.yaml b/config/routes/framework.yaml new file mode 100644 index 0000000..0fc74bb --- /dev/null +++ b/config/routes/framework.yaml @@ -0,0 +1,4 @@ +when@dev: + _errors: + resource: '@FrameworkBundle/Resources/config/routing/errors.xml' + prefix: /_error diff --git a/config/services.yaml b/config/services.yaml index 8087d8f..baf698d 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -2,7 +2,7 @@ # Files in the packages/ subdirectory configure your dependencies. # Put parameters here that don't need to change on each machine where the app is deployed -# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration +# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration parameters: services: diff --git a/public/index.php b/public/index.php index 3bcee0b..9982c21 100644 --- a/public/index.php +++ b/public/index.php @@ -1,22 +1,9 @@ bootEnv(dirname(__DIR__).'/.env'); - -if ($_SERVER['APP_DEBUG']) { - umask(0000); - - Debug::enable(); -} - -$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']); -$request = Request::createFromGlobals(); -$response = $kernel->handle($request); -$response->send(); -$kernel->terminate($request, $response); +return function (array $context) { + return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']); +}; diff --git a/src/Kernel.php b/src/Kernel.php index 655e796..779cd1f 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -3,36 +3,9 @@ namespace App; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use Symfony\Component\HttpKernel\Kernel as BaseKernel; -use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; class Kernel extends BaseKernel { use MicroKernelTrait; - - protected function configureContainer(ContainerConfigurator $container): void - { - $container->import('../config/{packages}/*.yaml'); - $container->import('../config/{packages}/'.$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'); - - 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); - } - } } diff --git a/symfony.lock b/symfony.lock index f9701a6..638f596 100644 --- a/symfony.lock +++ b/symfony.lock @@ -391,19 +391,18 @@ "version": "v5.2.5" }, "symfony/framework-bundle": { - "version": "5.2", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "5.2", - "ref": "6ec87563dcc85cd0c48856dcfbfc29610506d250" + "branch": "main", + "version": "5.4", + "ref": "3cd216a4d007b78d8554d44a5b1c0a446dab24fb" }, "files": [ "config/packages/cache.yaml", "config/packages/framework.yaml", - "config/packages/test/framework.yaml", "config/preload.php", - "config/routes/dev/framework.yaml", + "config/routes/framework.yaml", "config/services.yaml", "public/index.php", "src/Controller/.gitignore",