Skip to content

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

Open

Description

@ludovicsclain

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  🇷🇪 

Activity

  1. bwurst commented on Feb 13, 2024

    @bwurst

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions