From faa428742362ba2eb96baf377423b83761b596e9 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 22 Jul 2011 12:21:39 -0700 Subject: [PATCH] Added support for generic PDO connections. --- system/db/connector.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system/db/connector.php b/system/db/connector.php index aa3d8521..67f198e6 100644 --- a/system/db/connector.php +++ b/system/db/connector.php @@ -35,8 +35,8 @@ class Connector { case 'pgsql': return static::connect_to_server($config); - case 'odbc': - return static::connect_to_odbc($config); + default: + return static::connect_to_generic($config); } throw new \Exception('Database driver '.$config->driver.' is not supported.'); @@ -93,14 +93,14 @@ class Connector { } /** - * Connect to an ODBC data source. + * Connect to a generic data source. * * @param object $config * @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); } /**