-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Add DialogHelper::askHiddenResponse method #5731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
} | ||
|
||
return $value; | ||
} elseif ($this->hasSttyAvailable()) { |
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.
you don't need the elseif, just if
The link to the hiddeninput source code should be added in the readme. Btw, adding composer for hiddeninput does not make sense. Compsoer is about installing PHP code, not about downloading the source of a C++ program. |
This proposition comes from a discussion I had with Jordi , nothing more :) Romain On 11 oct. 2012, at 19:20, Christophe Coevoet notifications@github.com The link to the hiddeninput source code should be added in the readme. Btw, adding composer for hiddeninput does not make sense. Compsoer is about — |
Changelog updated, Readme note added, CS fixed |
$dialog->setInputStream($this->getInputStream("8AM\n")); | ||
|
||
$this->assertEquals('8AM', $dialog->askHiddenResponse($this->getOutputStream(), 'What time is it?')); | ||
} |
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.
This test should be skipped on Windows as it would trigger the binary, which will not work.
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.
It's fixed
the missing point is now the PR to the doc for this new feature |
Third Party | ||
----------- | ||
|
||
`HiddenInput.exe` third party binary is provided within this component. Find |
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.
The file is called hiddeninput.exe
all lowercased
@stof documentation added |
* | ||
* @return string The answer | ||
* | ||
* @throws \RuntimeException In case the fallback is disactivated and the response can not be hidden |
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.
disactivated
should be deactivated
@fabpot what you asked is now fixed |
This PR was merged into the master branch. Commits ------- aefa495 Mov 80D9 e `hiddeninput.exe` to Resources/bin c0f8a63 Fix CS and typos 26c35e0 Skip askHiddenResponse test on windows e2eaf5a Update Changelog, add Readme note about hidden input third party ac01d5d Fix tests and CS e396edb [Console] Add DialogHelper::askHiddenResponse method Discussion ---------- [Console] Add DialogHelper::askHiddenResponse method Bug fix: no Feature addition: yes Backwards compatibility break: no Symfony2 tests pass: yes License of the code: MIT It adds a method to `DialogHelper` to ask a question and hide the response. It's pretty cool when working with passwords. This code is more than largely inspired by Composer, see [ConsoleIO.php at line 140](https://github.com/composer/composer/blob/master/src/Composer/IO/ConsoleIO.php#L140) You will notice that this PR embeds a Windows Executable binary for windows support. This windows binary is provided by @Seldaek (see https://github.com/Seldaek/hidden-input) This dependency is not yet available via composer. If this is a problem to embed this file, we can think of other way to provide this support (make a package from HiddenInput and add composer recommandation for example). --------------------------------------------------------------------------- by stof at 2012-10-11T17:20:11Z The link to the hiddeninput source code should be added in the readme. And you should also update the changelog. Btw, adding composer for hiddeninput does not make sense. Compsoer is about installing PHP code, not about downloading the source of a C++ program. --------------------------------------------------------------------------- by romainneutron at 2012-10-11T17:22:58Z This proposition comes from a discussion I had with Jordi , nothing more :) Romain On 11 oct. 2012, at 19:20, Christophe Coevoet <notifications@github.com> wrote: The link to the hiddeninput source code should be added in the readme. And you should also update the changelog. Btw, adding composer for hiddeninput does not make sense. Compsoer is about installing PHP code, not about downloading the source of a C++ program. — Reply to this email directly or view it on GitHub<#5731 (comment)>. --------------------------------------------------------------------------- by romainneutron at 2012-10-12T07:33:00Z Changelog updated, Readme note added, CS fixed --------------------------------------------------------------------------- by stof at 2012-10-13T22:09:24Z the missing point is now the PR to the doc for this new feature --------------------------------------------------------------------------- by romainneutron at 2012-10-16T00:33:59Z @stof documentation added --------------------------------------------------------------------------- by romainneutron at 2012-10-16T09:10:35Z @fabpot what you asked is now fixed
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT
It adds a method to
DialogHelper
to ask a question and hide the response. It's pretty cool when working with passwords.This code is more than largely inspired by Composer, see ConsoleIO.php at line 140
You will notice that this PR embeds a Windows Executable binary for windows support. This windows binary is provided by @Seldaek (see https://github.com/Seldaek/hidden-input)
This dependency is not yet available via composer.
If this is a problem to embed this file, we can think of other way to provide this support (make a package from HiddenInput and add composer recommandation for example).