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.
This commit is contained in:
Jeremy Livingston 2014-12-23 13:17:13 -05:00
parent 9b501daf5a
commit 3b9c073711

View File

@ -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',