Adding common parameter handling for connection

and plugin params.
This commit is contained in:
mark_story 2009-05-03 20:48:13 -04:00
parent 1cc3a6ecfb
commit 6180ca80c9

View file

@ -52,6 +52,12 @@ class BakeShell extends Shell {
if (isset($this->{$task}) && !in_array($task, array('Project', 'DbConfig', 'Fixture'))) {
$path = Inflector::underscore(Inflector::pluralize($this->command));
$this->{$task}->path = $this->params['working'] . DS . $path . DS;
if (isset($this->params['connection'])) {
$this->{$task}->connection = $this->params['connection'];
}
if (isset($this->params['plugin'])) {
$this->{$task}->plugin = $this->params['plugin'];
}
if (!is_dir($this->{$task}->path)) {
$this->err(sprintf(__("%s directory could not be found.\nBe sure you have created %s", true), $task, $this->{$task}->path));
$this->_stop();