Browse Source

Fix driver and className setting on parsed DSNs

Jose Diaz-Gonzalez 11 years ago
parent
commit
4d231e5fb5
1 changed files with 3 additions and 7 deletions
  1. 3 7
      src/Core/StaticConfigTrait.php

+ 3 - 7
src/Core/StaticConfigTrait.php

@@ -205,19 +205,15 @@ trait StaticConfigTrait {
 			$parsed['password'] = $parsed['pass'];
 		}
 
+		$config = array_merge($queryArgs, $config, $parsed);
 		unset($config['user'], $config['pass']);
-		$config = array_filter($config, function ($value) {
-			return $value !== '';
-		});
-
-		$config = array_merge($queryArgs, $parsed, $config);
 
 		if ($driver !== null) {
-			if (!isset($config['driver'])) {
+			if (empty($config['driver'])) {
 				$config['driver'] = $driver;
 			}
 
-			if (!isset($config['className'])) {
+			if (empty($config['className'])) {
 				$config['className'] = $driver;
 			}
 		}