Reviewing the logic in the Shell::in($prompt, $options = null, $default = null)

This commit is contained in:
Fitorec 2012-01-15 21:16:45 -06:00
parent c8326460a4
commit ddbaa66997
2 changed files with 2 additions and 2 deletions

View file

@ -87,7 +87,7 @@ class DbConfigTask extends AppShell {
*/
protected function _interactive() {
$this->hr();
$this->out('Database Configuration:');
$this->out(__d('cake_console', 'Database Configuration:'));
$this->hr();
$done = false;
$dbConfigs = array();

View file

@ -456,7 +456,7 @@ class Shell extends Object {
}
}
if (is_array($options)) {
while ($in === '' || ($in !== '' && (!in_array(strtolower($in), $options) && !in_array(strtoupper($in), $options)) && !in_array($in, $options))) {
while ($in === '' || !(in_array(strtolower($in), $options) || in_array(strtoupper($in), $options) || in_array($in, $options))) {
$in = $this->_getInput($prompt, $options, $default);
}
}