Adding getConfig() so other tasks can pick connections more easily.

This commit is contained in:
mark_story 2009-04-28 20:44:23 -04:00
parent b5cc69c37c
commit 802ed73c0a

View file

@ -349,5 +349,25 @@ class DbConfigTask extends Shell {
$filename = $this->path.'database.php'; $filename = $this->path.'database.php';
return $this->createFile($filename, $out); return $this->createFile($filename, $out);
} }
/**
* Get a user specified Connection name
*
* @return void
**/
function getConfig() {
$useDbConfig = 'default';
$configs = get_class_vars('DATABASE_CONFIG');
if (!is_array($configs)) {
return $this->execute();
}
$connections = array_keys($configs);
if (count($connections) > 1) {
$useDbConfig = $this->in(__('Use Database Config', true) .':', $connections, 'default');
}
return $useDbConfig;
}
} }
?> ?>