Skip to content

Commit 575ba15

Browse files
committed
feature symfony#24389 [DoctrineBridge] Deprecate dbal session handler (Tobion)
This PR was merged into the 3.4 branch. Discussion ---------- [DoctrineBridge] Deprecate dbal session handler | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no <!-- don't forget updating src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | symfony#20501 | License | MIT | Doc PR | The DbalSessionHandler misses all the improvements from the PdoSessionHandler (lock modes, delayed GC, configurable naming). The only advantage it had was the ability to work with non-pdo drivers. But since DBAL requires PDO now as well (doctrine/dbal@36df682) even that is not really relevant anymore. Stofs argument in symfony#20501 (comment) sound like a new feature that can be implemented separately. Ref. symfony#24267 Commits ------- ffc74eb [DoctrineBridge] Deprecate DbalSessionHandler
2 parents 02b77f5 + ffc74eb commit 575ba15

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandler.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Bridge\Doctrine\HttpFoundation;
1313

14+
@trigger_error(sprintf('The class %s is deprecated since version 3.4 and will be removed in 4.0. Use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler instead.', DbalSessionHandler::class), E_USER_DEPRECATED);
15+
1416
use Doctrine\DBAL\Connection;
1517
use Doctrine\DBAL\Driver\DriverException;
1618
use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
@@ -25,6 +27,8 @@
2527
* @author Fabien Potencier <[email protected]>
2628
* @author Johannes M. Schmitt <[email protected]>
2729
* @author Tobias Schultze <http://tobion.de>
30+
*
31+
* @deprecated since version 3.4, to be removed in 4.0. Use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler instead.
2832
*/
2933
class DbalSessionHandler implements \SessionHandlerInterface
3034
{

src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandlerSchema.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@
1111

1212
namespace Symfony\Bridge\Doctrine\HttpFoundation;
1313

14+
@trigger_error(sprintf('The class %s is deprecated since version 3.4 and will be removed in 4.0. Use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler::createTable instead.', DbalSessionHandlerSchema::class), E_USER_DEPRECATED);
15+
1416
use Doctrine\DBAL\Schema\Schema;
1517

1618
/**
1719
* DBAL Session Storage Schema.
1820
*
1921
* @author Johannes M. Schmitt <[email protected]>
22+
*
23+
* @deprecated since version 3.4, to be removed in 4.0. Use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler::createTable instead.
2024
*/
2125
final class DbalSessionHandlerSchema extends Schema
2226
{

src/Symfony/Bridge/Doctrine/Tests/HttpFoundation/DbalSessionHandlerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
* Test class for DbalSessionHandler.
1919
*
2020
* @author Drak <[email protected]>
21+
*
22+
* @group legacy
2123
*/
2224
class DbalSessionHandlerTest extends TestCase
2325
{

0 commit comments

Comments
 (0)