Skip to content
Snippets Groups Projects
Commit 4e6efa28 authored by Stefan Bürk's avatar Stefan Bürk
Browse files

[TASK] Implement PDO DriverResult as `doctrine/dbal driver middleware`

TYPO3 v12 upgraded to Doctrine DBAL 3.2 with #96287 and cloned a
couple of doctrine PDO related classes to provide the mandatory
`resource to string` mapping for PDO drivers. At that point this
was the only way to mitigate the fact, that `final` has been added
to these classes with Doctrine DBAL 3.1 [1].

The doctrine team introduced the new driver middleware concept
with Doctrine DBAL 3.0.0 [2] and allows the decorator pattern
to be used for Driver, Driver/Connection, Driver/Statement and
Driver/Result.

General support for connection driver middlewares (#100089) and
global driver middlewares (#102496) has been added meanwhile to
TYPO3. Additionally, sortable configuration for middlewares has
been improved with #102586.

This change migrates towards the driver middleware pattern and
reduces the code required to be maintained and check on doctrine
upgrades because cloned and changed classes can be removed and
replaced by minimal decorator implementations.

`\TYPO3\CMS\Core\Database\Middleware\UsableForConnectionInterface`
has been added with #102587 which helps to limit the driver mapping
to supported `pdo_*` driver only.

The superfluous internal classes are removed as non-breaking
following the TYPO3 core policies.

[1] https://github.com/doctrine/dbal/blob/3.7.x/UPGRADE.md#bc-break-changes-in-driver-classes
[2] https://github.com/doctrine/dbal/pull/4157

Resolves: #102588
Related: #102587
Related: #102586
Related: #102496
Related: #100089
Related: #96287
Releases: main
Change-Id: Ia17d104129a1199fa318baf0b66be29445f0f72b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82071


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
parent abc78240
Branches
Tags
Showing
with 363 additions and 595 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment