mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Merge branch '2.1' into 2.2
This commit is contained in:
commit
9628910c86
1 changed files with 33 additions and 18 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue