Commit faa42874 authored by Taylor Otwell's avatar Taylor Otwell

Added support for generic PDO connections.

parent e0a8d173
...@@ -35,8 +35,8 @@ class Connector { ...@@ -35,8 +35,8 @@ class Connector {
case 'pgsql': case 'pgsql':
return static::connect_to_server($config); return static::connect_to_server($config);
case 'odbc': default:
return static::connect_to_odbc($config); return static::connect_to_generic($config);
} }
throw new \Exception('Database driver '.$config->driver.' is not supported.'); throw new \Exception('Database driver '.$config->driver.' is not supported.');
...@@ -93,14 +93,14 @@ class Connector { ...@@ -93,14 +93,14 @@ class Connector {
} }
/** /**
* Connect to an ODBC data source. * Connect to a generic data source.
* *
* @param object $config * @param object $config
* @return PDO * @return PDO
*/ */
private static function connect_to_odbc($config) private static function connect_to_generic($config)
{ {
return new \PDO($config->dsn, $config->username, $config->password, static::$options); return new \PDO($config->driver.':'.$config->dsn, $config->username, $config->password, static::$options);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment