Review main Merged

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

Stefan Bürk CR +2 V +2 Hard +369 −595 updated 01/09/24, 10:56

Commit message

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

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 6

Files 21

Show 1 more file