Browse Source

Refactoring DB\Connector.

Taylor Otwell 13 years ago
parent
commit
e6e7586dbc
1 changed files with 7 additions and 6 deletions
  1. 7 6
      system/db/connector.php

+ 7 - 6
system/db/connector.php

@@ -26,13 +26,14 @@ class Connector {
 	{
 		$config = static::configuration($connection);
 
-		if ($config->driver == 'sqlite')
+		switch ($config->driver)
 		{
-			return static::connect_to_sqlite($config);
-		}
-		elseif ($config->driver == 'mysql' or $config->driver == 'pgsql')
-		{
-			return static::connect_to_server($config);
+			case 'sqlite':
+				return static::connect_to_sqlite($config);
+
+			case 'mysql':
+			case 'pgsql':
+				return static::connect_to_server($config);
 		}
 
 		throw new \Exception('Database driver '.$config->driver.' is not supported.');