ezsystems/ezpublish-kernel — pull request #620 by beberlei (2013-11-16 10:28:14+00:00)
Title: [WIP] Soft-migration from Zeta Components Database to Doctrine DBAL

This Pull Request is a first prototype for migrating to Doctrine DBAL as a database abstraction layer instead of Zeta Components Database.

The `doc/specificiations/refactorings/doctrine-dbal.rst` contains an overview of the work to be done. Refactoring option 2 was chosen, where a Zeta Components compatible Query API is developed to avoid rewriting all the gateways. The prototype introduces a new `eZ\Publish\Core\Persistence\Database` namespace with interfaces for this abstraction. The Doctrine implementation is located in `eZ\Publish\Core\Persistence\Doctrine` and contains a limited set of tests (could be improved).

The Gateways have all been adjusted to use the new handler abstraction and implemented as much that the integration tests pass on SQLite.

Tasks:

- [ ] Rename `EzcDatabase` gateway classes to `DatabaseHandler` or `DoctrineDatabase`
- [ ] Fix `eZ\Publish\Core\Persistence\Legacy\Handler` to directly accept a `\Doctrine\DBAL\Connection` instead of the `EzcDbHandler`. This requires changing the testcases that construct database connections. As Doctrine does not have a syntax for creating a connection from a DSN, this code has to be ported.
- [ ] Evaluate the change of the `rightJoin` query to not use a RIGHT JOIN. Is this semantically correct? The right join seemed unnecessary, since the WHERE clause uses both tables.
- [ ] Fix tests on all platforms

More Todos forthcoming..