Skip to content

Commit

Permalink
Adding getConfig() so other tasks can pick connections more easily.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Apr 29, 2009
1 parent b5cc69c commit 802ed73
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions cake/console/libs/tasks/db_config.php
Expand Up @@ -349,5 +349,25 @@ function bake($configs) {
$filename = $this->path.'database.php';
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;
}
}
?>

0 comments on commit 802ed73

Please sign in to comment.