Fixed issue when no dbname provided in the DSN

This commit is contained in:
William DURAND 2011-12-15 16:32:05 +01:00
commit c0221a604e
3 changed files with 18 additions and 3 deletions

View file

@ -45,7 +45,12 @@ class DatabaseCreateCommand extends AbstractPropelCommand
list($name, $config) = $this->getConnection($input, $output);
$dbName = $this->parseDbName($config['connection']['dsn']);
$query = 'CREATE DATABASE '. $dbName .';';
if (null === $dbName) {
return $output->writeln('<error>No database name found.</error>');
} else {
$query = 'CREATE DATABASE '. $dbName .';';
}
try {
\Propel::setConfiguration($this->getTemporaryConfiguration($name, $config));