Added a method to get the dbname in Command classes
This commit is contained in:
parent
2c6c884861
commit
c7f5ed7e2b
|
@ -292,6 +292,16 @@ EOT;
|
|||
return array($name, $defaultConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract the database name from a given DSN
|
||||
* @param string $dsn A DSN
|
||||
* @return string The database name extracted from the given DSN
|
||||
*/
|
||||
protected function parseDbName($dsn) {
|
||||
preg_match('#dbname=([a-zA-Z0-9\_]+)#', $dsn, $matches);
|
||||
return $matches[1];
|
||||
}
|
||||
|
||||
/**
|
||||
* Write Propel output as summary.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue