This repository was archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
Unsupported driver Exception #105
Copy link
Copy link
Open
Description
Hello again,
In issue #103 I've changed DB_CONNECTION to mysql and driver for this connection to pdo_mysql. Howere, now there is some issue when I register new user using default AuthController and Doctrine driver provided by this lib.
When I send POST request to localhost/auth/register to register user I got:
InvalidArgumentException in ConnectionFactory.php line 189:
Unsupported driver [pdo_mysql]
I tried to debug, this. In ConnectionFactory class there's method
public function createConnector(array $config)
{
if (!isset($config['driver'])) {
throw new InvalidArgumentException('A driver must be specified.');
}
if ($this->container->bound($key = "db.connector.{$config['driver']}")) {
return $this->container->make($key);
}
switch ($config['driver']) {
case 'mysql':
return new MySqlConnector;
case 'pgsql':
return new PostgresConnector;
case 'sqlite':
return new SQLiteConnector;
case 'sqlsrv':
return new SqlServerConnector;
}
throw new InvalidArgumentException("Unsupported driver [{$config['driver']}]");
}
And I found that my $config['driver'] is set to pdo_mysql as expected, but as we can see there's no pdo_mysql in switch.
How to setup this driver correctly?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels