-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Conversation
|
||
$this->setPromptText($promptText); | ||
$this->setEcho($echo); | ||
$this->password = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this $this->password = ''
is required as it is a duplicate from line 27
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I'll pull it.
Nice one. 👍 |
*/ | ||
public function setPromptText($promptText) | ||
{ | ||
$this->promptText = $promptText; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would type case this $this->promptText = (string) $promptText;
$char = $this->getConsole()->readChar(); | ||
|
||
if (PHP_EOL == $char) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unneeded blank line
The tests seem to pass, but the build gets terminated... End of output...
|
I was not able to request Travis to rebuild this branch. I looked at previous commits in this branch and they fail on Travis for the same reason. Tests seem to pass fine, the build gets @richardjh Is it worth merging master in again? |
I just checked |
@eddiejaoude, are you saying I need to pull the master branch from zendframework/zf2 into my master branch on richardjh/zf2 again? |
Originally, I was suggesting updating your PR branch (richardjh/zf2:master) with the master of zendframework/zf2:master - but when I checked the source branch (zendframework/zf2:master), it is failing too. So probably no need, unless there is a manual conflict to resolve before your PR gets merged in - as they are new files, it is unlikely there will be a future conflict. |
Just a little suggestion, what about making the "mask" character configurable? (e.g. if someone wanted to use |
@asgrim good idea 👍 |
/** | ||
* @var string | ||
*/ | ||
protected $promptText = 'Password : '; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 'Password: ' not 'Password : '
Changed the default password prompt, that you can change anyway because @prolic said so.
Not sure if anyone is waiting for this or needs a password prompt, but I have added richardjh\zf2-password to packagist [ https://packagist.org/packages/richardjh/zf2-password ] so you can install the password prompt as a module if you like. |
Thanks @richardjh 👍 |
nice |
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2015 ;)
…t through direct buffer output
…e password prompt unless strictly specified
This was merged into I had to rewrite some bits because the prompt was actually acting really weird when entering multiple rapidly subsequent chars: figured that (for security) the best solution was to clear the line at every keystroke instead. |
…embers `private`
…ers for options
…ad of via an actual console adapter (which would hang forever, waiting for input)
…e state change (password kept in memory!)
…ompt over repeated requests
…rd` prompt replaces input with `*`
…ugh the console adapter, not through direct buffer output
…e performed by the console prompt
…ut should be produced by the password prompt unless strictly specified
…rd-prompt' into develop Close zendframework/zendframework#6646
SImple prompt that doesn't echo back (or can echo *s). Useful for reading in passwords.
If accepted I'll write up the documentation too.