Browse Source

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

Fitorec 14 years ago
parent
commit
ddbaa66997
2 changed files with 2 additions and 2 deletions
  1. 1 1
      lib/Cake/Console/Command/Task/DbConfigTask.php
  2. 1 1
      lib/Cake/Console/Shell.php

+ 1 - 1
lib/Cake/Console/Command/Task/DbConfigTask.php

@@ -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();

+ 1 - 1
lib/Cake/Console/Shell.php

@@ -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);
 			}
 		}