Skip to content

6.4.1

Choose a tag to compare

@datasage datasage released this 04 Aug 19:35
· 9 commits to 6.4.x since this release

Bug fix only. No dependency or API changes since 6.4.0.

Connection services no longer connect eagerly

6.4.0 guarded the DBAL 4 removal of markDoctrineTypeCommented() like this:

if (method_exists($connection->getDatabasePlatform(), 'markDoctrineTypeCommented')) {

which resolves the platform unconditionally. On any server whose version has to be negotiated (PostgreSQL, MySQL), DBAL connects in order to resolve it — so merely building a doctrine.connection.* service opened a socket.

Before 6.4.0, getDatabasePlatform() was only reached inside the two foreach loops, and therefore not called at all when neither doctrineTypeMappings nor doctrineCommentedTypes were configured.

The platform is now resolved once, and only when there is something to apply.

Test coverage

The existing testNoConnectWithoutCustomMappingsAndCommentedTypes asserts exactly the right thing (isConnected() is false) but could not catch this — it uses SQLite, whose platform resolves without connecting.

The new testDoesNotResolvePlatformWhenThereIsNothingToApply points the factory at an unreachable MySQL connection. It throws Connection refused against the 6.4.0 behaviour and passes now.