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

getName() method does not exist for class Doctrine\DBAL\Driver\PDO\MySQL\Driver #192

Open
ludovicsclain opened this issue Jan 31, 2024 · 1 comment

Comments

@ludovicsclain
Copy link

Hey there 👋 
When I try to use the plugin with my WordPress database I get this error in my logs:

Call to undefined method Doctrine\\DBAL\\Driver\\PDO\\MySQL\\Driver::getName() in file '~/apps/user_sql/lib/Platform/PlatformFactory.php' line 42

It seems that the getName() method does not exist for the Doctrine\DBAL\Driver\PDO\MySQL\Driver class. This is probably due to an update to the Doctrine DBAL library where this method was removed or renamed (I'm using NextCloud v.25).

A possible solution would be to replace the call to the getName() method with the use of the getDatabasePlatform() method.

Any information on this please?
Thank you for your help!
Warm regards,
Ludovic  🇷🇪 

@bwurst
Copy link

bwurst commented Feb 13, 2024

Rewrote the function like below, error is gone. Most likely the call to this class should be rewritten and the class removed. But I have no clue about Doctrine and all this MVC stuff.

    public static function getPlatform(Connection $connection)
    {
        return new $connection->getDriver()->getDatabasePlatform()($connection);
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants