From 62ffbc84c780a01855646de4cdecbded7a6efbc2 Mon Sep 17 00:00:00 2001 From: stakovicz Date: Sun, 11 Feb 2024 11:17:25 +0100 Subject: [PATCH] Revert "#1415 Session in DB" This reverts commit 201b453c4e9cf72091b648f8891c33ab25f9fcab. --- app/config/config.yml | 5 +++-- app/config/services.yml | 6 ------ db/migrations/20240106213200_sessions.php | 20 -------------------- htdocs/app.php | 4 ++++ htdocs/include/prepend.inc.php | 2 ++ htdocs/pages/planete/app.php | 4 ++++ 6 files changed, 13 insertions(+), 28 deletions(-) delete mode 100644 db/migrations/20240106213200_sessions.php diff --git a/app/config/config.yml b/app/config/config.yml index 4b1c2a604..ba6ace5db 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -332,8 +332,9 @@ framework: default_locale: "%locale%" trusted_hosts: ~ session: - # https://symfony.com/doc/4.x/session/database.html#store-sessions-in-a-relational-database-mariadb-mysql-postgresql - handler_id: Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler + # http://symfony.com/doc/current/reference/configuration/framework.html#handler-id + storage_id: session.storage.php_bridge + handler_id: ~ fragments: ~ http_method_override: true assets: ~ diff --git a/app/config/services.yml b/app/config/services.yml index 500d5d19f..a7f4ed75e 100644 --- a/app/config/services.yml +++ b/app/config/services.yml @@ -14,12 +14,6 @@ services: _defaults: public: true - Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler: - public: false - arguments: - - 'mysql:host=%database_host%;port=%database_port%;dbname=%database_name%' - - { db_username: '%database_user%', db_password: '%database_password%' } - AppBundle\Controller\Event\: resource: '../../sources/AppBundle/Controller/Event/*' autowire: true diff --git a/db/migrations/20240106213200_sessions.php b/db/migrations/20240106213200_sessions.php deleted file mode 100644 index 573670a9d..000000000 --- a/db/migrations/20240106213200_sessions.php +++ /dev/null @@ -1,20 +0,0 @@ -execute($sql); - } -} diff --git a/htdocs/app.php b/htdocs/app.php index db685d027..0f8f3d655 100644 --- a/htdocs/app.php +++ b/htdocs/app.php @@ -19,6 +19,8 @@ exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); } + session_start(); + /** @var \Composer\Autoload\ClassLoader $loader */ $loader = require __DIR__.'/../vendor/autoload.php'; Debug::enable(); @@ -32,6 +34,8 @@ /** @var \Composer\Autoload\ClassLoader $loader */ $loader = require __DIR__.'/../vendor/autoload.php'; + session_start(); + $kernel = new AppKernel('prod', false); } diff --git a/htdocs/include/prepend.inc.php b/htdocs/include/prepend.inc.php index 09206b26e..ef8c2170a 100644 --- a/htdocs/include/prepend.inc.php +++ b/htdocs/include/prepend.inc.php @@ -3,6 +3,8 @@ // Initialisation ob_start(); +session_start(); + // Inclusion de l'autoload de composer require_once dirname(__FILE__) . '/../../vendor/autoload.php'; diff --git a/htdocs/pages/planete/app.php b/htdocs/pages/planete/app.php index ccee78e7c..4169d0a70 100644 --- a/htdocs/pages/planete/app.php +++ b/htdocs/pages/planete/app.php @@ -28,6 +28,8 @@ exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); } + session_start(); + /** @var ClassLoader $loader */ $loader = require __DIR__.'/../../../vendor/autoload.php'; Debug::enable(); @@ -41,6 +43,8 @@ /** @var ClassLoader $loader */ $loader = require __DIR__.'/../../../vendor/autoload.php'; + session_start(); + $kernel = new PlaneteAppKernel('prod', false); }