Commit 49961c48 by Carsten Brandt

change Console::confirm() output to use stdout

parent 95afdceb
......@@ -21,6 +21,7 @@ Yii Framework 2 Change Log
- Enh #5600: Allow configuring debug panels in `yii\debug\Module::panels` as panel class name strings (qiangxue)
- Enh #5613: Added `--overwrite` option to Gii console command to support overwriting all files (motin, qiangxue)
- Enh #5646: Call `yii\base\ErrorHandler::unregister()` instead of `restore_*_handlers` directly (aivus)
- Enh: `Console::confirm()` now uses `Console::stdout()` instead of `echo` to be consistent with all other functions (cebe)
2.0.0 October 12, 2014
----------------------
......
......@@ -763,13 +763,13 @@ class BaseConsole
/**
* Asks user to confirm by typing y or n.
*
* @param string $message to echo out before waiting for user input
* @param string $message to print out before waiting for user input
* @param boolean $default this value is returned if no selection is made.
* @return boolean whether user confirmed
*/
public static function confirm($message, $default = false)
{
echo $message . ' (yes|no) [' . ($default ? 'yes' : 'no') . ']:';
static::stdout($message . ' (yes|no) [' . ($default ? 'yes' : 'no') . ']:');
$input = trim(static::stdin());
return empty($input) ? $default : !strncasecmp($input, 'y', 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment