-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EZP-31088: Refactored Content GW to use Doctrine\DBAL #2845
Merged
alongosz
merged 20 commits into
ezsystems:master
from
alongosz:ezp-31088-replace-content-gw-dbh-with-doctrine
Mar 16, 2020
Merged
EZP-31088: Refactored Content GW to use Doctrine\DBAL #2845
alongosz
merged 20 commits into
ezsystems:master
from
alongosz:ezp-31088-replace-content-gw-dbh-with-doctrine
Mar 16, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6826b1b
to
7b83852
Compare
52a2429
to
efd7821
Compare
efd7821
to
063aa4a
Compare
063aa4a
to
64c8555
Compare
64c8555
to
6571286
Compare
6571286
to
766d64c
Compare
6 tasks
d41ffc5
to
c9dce64
Compare
ViniTou
approved these changes
Mar 3, 2020
eZ/Publish/Core/Persistence/Legacy/SharedGateway/GatewayFactory.php
Outdated
Show resolved
Hide resolved
mikadamczyk
approved these changes
Mar 3, 2020
eZ/Publish/Core/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php
Outdated
Show resolved
Hide resolved
eZ/Publish/Core/Persistence/Legacy/Content/Gateway/ExceptionConversion.php
Show resolved
Hide resolved
adamwojs
reviewed
Mar 3, 2020
eZ/Publish/Core/Persistence/Legacy/SharedGateway/GatewayFactory.php
Outdated
Show resolved
Hide resolved
eZ/Publish/Core/Persistence/Legacy/SharedGateway/GatewayFactory.php
Outdated
Show resolved
Hide resolved
eZ/Publish/Core/Persistence/Legacy/SharedGateway/DatabasePlatform/SqliteGateway.php
Outdated
Show resolved
Hide resolved
eZ/Publish/Core/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php
Outdated
Show resolved
Hide resolved
c9dce64
to
e5a0f64
Compare
adamwojs
approved these changes
Mar 10, 2020
The *::getContext methods were used as a workaround for lack of dependency injection.
* Implemented Gateway Factory to obtain a Gateway for a specific database platform. * Implemented SQLite and Fallback shared Gateways. * Implemented Gateway::getColumnNextIntegerValue method. * Defined Gateway in the Symfony DIC configuration.
* Introduced strict types * Aligned PHPDoc (not required for strict types) * Aligned code style * Marked Legacy\Content\Gateway\DoctrineDatabase class as final and internal * Marked Legacy\Content\Gateway\DoctrineDatabase\QueryBuilder class as final and internal * Marked Legacy\Content\Gateway\ExceptionConversion class as final and internal
Gateways are intended for internal use by the Legacy Storage and should not be injected by external packages.
* Dropped no longer needed createVersionInfoQueryBuilder
We assume that integer returned for insert methods is well understood as a new ID generated by a database
0f735c0
to
5c18cab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA Approved on eZ Platform EE v3.0 master with diff.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
master (8.0@dev)
for eZ Platformv3.0
This PR refactors the Legacy Content Gateway implementation (
\eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase
) to rely on\Doctrine\DBAL\Connection
instead of our custom Database Handler.Shared Gateway
The tables in our schema:
ezcontentobject_attribute
,ezcontentclass
, andezcontentclass_attribute
have composite primary key with an auto-increment, which is not supported by SQLite3. Therefore, similar to this hack I've introduced Shared gateway, meant to be injected into various gateways, if needed. It creates in-memory sequence for SQLite. I decided not to differentiate this operation based on table name as the impact is rather minimal (SQLite is used for integration tests due to its good performance and setup simplicity).At the same time I've dropped generating sequence name from table and column name in favor of literal constants defined for proper gateways. The reasoning behind this is that sequence is a unique database object, in the same way as tables/relations.
Implemented via d6a9984dd5b7d6d0a0b4d359c045bcaece6f2b94.
QA
TODO:
$this->connection
$dbHandler
argument from the implementation.$ composer fix-cs
).