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

Support for DBAL 3's platform classes #8946

Merged
merged 1 commit into from
Aug 29, 2021

Conversation

derrabus
Copy link
Member

@derrabus derrabus commented Aug 22, 2021

In DBAL 3, various platform classes have been removed or renamed. Furthermore, DBAL 3.2 will deprecate the AbstractPlatform::getName() method.

This PR makes the necessary adjustments in ORM.

use function get_class;
use function sprintf;

// DBAL 2 compatibility
class_exists('Doctrine\DBAL\Platforms\MySqlPlatform');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a tricky one. The class name was changed from MySqlPlatform to MySQLPlatform. Class names are case-insensitive in PHP, so just using the new name would theoretically work. However, on a case-sensitive filesystem, autoloading would fail if the case does not match. This is why I'm triggering the autoloader with old and new class name.

@derrabus derrabus added this to the 2.10.0 milestone Aug 23, 2021
@derrabus derrabus force-pushed the bugfix/dbal-3-platforms branch 2 times, most recently from e94153d to 4ec8eda Compare August 24, 2021 02:20
@derrabus derrabus force-pushed the bugfix/dbal-3-platforms branch 4 times, most recently from 4f1ec5c to 24407e5 Compare August 29, 2021 13:25
Signed-off-by: Alexander M. Turek <me@derrabus.de>
@derrabus
Copy link
Member Author

PR is ready again.

@greg0ire greg0ire merged commit ef9c984 into doctrine:2.10.x Aug 29, 2021
@greg0ire
Copy link
Member

Thanks @derrabus !

@derrabus derrabus deleted the bugfix/dbal-3-platforms branch August 29, 2021 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants