Browse Source

Fix Database/ from always being appended to the driver name.

Fixes #3223
mark_story 13 years ago
parent
commit
3dd82e6d88
1 changed files with 4 additions and 1 deletions
  1. 4 1
      lib/Cake/Console/Command/Task/DbConfigTask.php

+ 4 - 1
lib/Cake/Console/Command/Task/DbConfigTask.php

@@ -315,8 +315,11 @@ class DbConfigTask extends AppShell {
 			$config = array_merge($this->_defaultConfig, $config);
 			extract($config);
 
+			if (strpos($datasource, 'Database/') === false) {
+				$datasource = "Database/{$datasource}";
+			}
 			$out .= "\tpublic \${$name} = array(\n";
-			$out .= "\t\t'datasource' => 'Database/{$datasource}',\n";
+			$out .= "\t\t'datasource' => '{$datasource}',\n";
 			$out .= "\t\t'persistent' => {$persistent},\n";
 			$out .= "\t\t'host' => '{$host}',\n";