Merge branch '2.1' into 2.2

This commit is contained in:
mark_story 2012-05-12 20:26:36 -04:00
commit 9628910c86

View file

@ -105,6 +105,38 @@ class ExtractTask extends AppShell {
*/
protected $_validationDomain = 'default';
/**
* Method to interact with the User and get path selections.
*
* @return void
*/
protected function _getPaths() {
$defaultPath = APP;
while (true) {
$currentPaths = count($this->_paths) > 0 ? $this->_paths : array('None');
$message = __d(
'cake_console',
"Current paths: %s\nWhat is the path you would like to extract?\n[Q]uit [D]one",
implode(', ', $currentPaths)
);
$response = $this->in($message, null, $defaultPath);
if (strtoupper($response) === 'Q') {
$this->out(__d('cake_console', 'Extract Aborted'));
return $this->_stop();
} elseif (strtoupper($response) === 'D' && count($this->_paths)) {
$this->out();
return;
} elseif (strtoupper($response) === 'D') {
$this->err(__d('cake_console', '<warning>No directories selected.</warning> Please choose a directory.'));
} elseif (is_dir($response)) {
$this->_paths[] = $response;
$defaultPath = 'D';
} else {
$this->err(__d('cake_console', 'The directory path you supplied was not found. Please try again.'));
}
$this->out();
}
}
/**
* Execution method always used for tasks
*
@ -127,24 +159,7 @@ class ExtractTask extends AppShell {
$this->_paths = array(CakePlugin::path($plugin));
$this->params['plugin'] = $plugin;
} else {
$defaultPath = APP;
$message = __d('cake_console', "What is the path you would like to extract?\n[Q]uit [D]one");
while (true) {
$response = $this->in($message, null, $defaultPath);
if (strtoupper($response) === 'Q') {
$this->out(__d('cake_console', 'Extract Aborted'));
$this->_stop();
} elseif (strtoupper($response) === 'D') {
$this->out();
break;
} elseif (is_dir($response)) {
$this->_paths[] = $response;
$defaultPath = 'D';
} else {
$this->err(__d('cake_console', 'The directory path you supplied was not found. Please try again.'));
}
$this->out();
}
$this->_getPaths();
}
if (!empty($this->params['exclude-plugins']) && $this->_isExtractingApp()) {