diff --git a/Command/PhingCommand.php b/Command/PhingCommand.php index 854c053..6402a9c 100644 --- a/Command/PhingCommand.php +++ b/Command/PhingCommand.php @@ -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. *