Use the DsnParser to handle the url option #1669
Merged
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.
The DsnParser tool is used in the ConnectionFactory to support the
url
option (the processing is done in the same way than the deprecated logic in DBAL's DriverManager).As the goal of Symfony is to be compatible out-of-the-box with cloud providers, we always register a default mapping of schemes to DBAL drivers instead of forcing to use DBAL driver names directly, as this is unlikely to happen. For instance, the Postgresql project defines URI-based connection strings that can use
postgres
orpostgresql
as scheme, so cloud providers that are not tied to Doctrine DBAL only will use one of those for sure. But DBAL has drivers namedpgsql
andpdo_pgsql
depending on the extension name. However, unlike the old DBAL logic which forced the choice of which of the drivers is used for those standard schemes (which was the reason to deprecate those aliases in DBAL itself in favor of a configurable DsnParser), the bundle allows to configure the driver used for each scheme. The configured schemes are merged with the default map (and they win over our default map).Closes #1665