Skip to content
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

Introduce the SchemaManagerFactory interface #5876

Merged
merged 1 commit into from
Jan 31, 2023

Conversation

derrabus
Copy link
Member

… to allow apps to override the default schema managers

Q A
Type feature
Fixed issues Fixes #5812

Summary

This PR introduces a new interface SchemaManagerFactory that can be implemented by apps that need to override the schema manager. It also ships with two implementations:

LegacySchemaManagerFactory

This factory implements the current and deprecated way of letting the driver create the schema manager. If no factory is configured, we fall back to this implementation.

DefaultSchemaManagerFactory

This factory implements the new way of letting the platform class create the schema manager. This way was introduced by #5458. Configuring DefaultSchemaManagerFactory as factory will allow apps to opt-in to the behavior that we have on the 4.0.x branch.

The factory can be configured through the Configuration class:

$configuration = new Configuration();
$configuration->setSchemaManagerFactory($mySchemaManagerFactory);

$connection = DriverManager::getConnection([/* your connection parameters */], $configuration);

… to allow apps to override the default schema managers
@derrabus derrabus force-pushed the feature/schema-manager-factory branch from 6049b57 to 537b711 Compare January 28, 2023 12:20
@derrabus derrabus added this to the 3.6.0 milestone Jan 28, 2023
@derrabus derrabus merged commit 26d1542 into doctrine:3.6.x Jan 31, 2023
@derrabus derrabus deleted the feature/schema-manager-factory branch January 31, 2023 22:52
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants