From 3b9c0737113879e662b865d9b2e44cd19bf463e6 Mon Sep 17 00:00:00 2001 From: Jeremy Livingston Date: Tue, 23 Dec 2014 13:17:13 -0500 Subject: [PATCH] Add deprecation warning to LegacyPdoSessionHandler LegacyPdoSessionHandler has been deprecated in favor of PdoSessionHandler. Trigger an E_USER_DEPRECATED error when the deprecated class is used. --- .../Session/Storage/Handler/LegacyPdoSessionHandler.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/LegacyPdoSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/LegacyPdoSessionHandler.php index fff83315aa..df31832701 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/LegacyPdoSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/LegacyPdoSessionHandler.php @@ -76,6 +76,9 @@ class LegacyPdoSessionHandler implements \SessionHandlerInterface if (\PDO::ERRMODE_EXCEPTION !== $pdo->getAttribute(\PDO::ATTR_ERRMODE)) { throw new \InvalidArgumentException(sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION))', __CLASS__)); } + + trigger_error('"Symfony\Component\HttpFoundation\Session\Storage\Handler\LegacyPdoSessionHandler" is deprecated since version 2.6 and will be removed in 3.0. Use "Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler" instead.', E_USER_DEPRECATED); + $this->pdo = $pdo; $dbOptions = array_merge(array( 'db_id_col' => 'sess_id',