Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Console] default to stderr in the console helpers#15794
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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 should be outside the loop
Tobion commentedSep 14, 2015
Could you create another PR against 2.7 that changes |
alcohol commentedSep 14, 2015
Yes already working on a PR for 2.7. Are |
Tobion commentedSep 14, 2015
SymfonyQuestionHelper extends QuestionHelper and thus should be convered already |
alcohol commentedSep 14, 2015
Please let me know if#15795 covers it or if any amendments need to be made. |
alcohol commentedSep 14, 2015
@Seldaek here you go (again). |
Tobion commentedSep 14, 2015
👍 Status: Reviewed |
stof commentedSep 15, 2015
Tests covering this are missing |
alcohol commentedSep 15, 2015
What would be an acceptable test scenario in your opinion, to validate these changes? |
stof commentedSep 15, 2015
@alcohol Creating the helper with a ConsoleOutputInterface, and asserting that it writes its output to the error output. |
alcohol commentedSep 15, 2015
Allright. Will implement something later today. Thanks for the feedback. |
Tobion commentedSep 20, 2015
Status: Needs Work |
alcohol commentedSep 21, 2015
@Tobion got any tips? I tried the following for the publicfunctiontestAskOnStderrWithConsoleOutput() {if (!$this->hasSttyAvailable()) {$this->markTestSkipped('`stderr` is required to test stderr output functionality'); }$dialog =newDialogHelper();$dialog->setInputStream($this->getInputStream("\nnot stdout\n"));$this->assertEquals('stderr',$dialog->ask(newConsoleOutput(),'Where should output go?','stderr'));$this->assertEquals('not stdout',$dialog->ask($output =newConsoleOutput(),'Where should output go?','stderr'));rewind($output->getErrorOutput()->getStream());$this->assertEquals('Where should output go?',stream_get_contents($output->getErrorOutput()->getStream())); } I noticed all the tests use |
alcohol commentedSep 21, 2015
… (alcohol)This PR was merged into the 2.7 branch.Discussion----------[Console] Default to stderr for the console helpers (2.7+)Interactive input/output and informational output such as progress should go to `stderr` if available.| Q | A| ------------- | ---| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets || License | MIT| Doc PR |Only merge if#15794 is merged.If someone explicitly wants to use `stdout`, they can simply pass `$output->getStream()` instead of `$output` in most use-cases.Commits-------90c2a96 Default to stderr for console helpers (only merge if#15794 gets merged)
* 2.7: [Config] Fix enum default value in Yaml dumper Finnish translation fix [CssSelector] Optimize regexs matching simple selectors Fix the phpdoc in the CssSelector TranslatorInterface [Console] Add clock mock to fix transient test on HHVM [DomCrawler] Optimize the regex used to find namespace prefixes [EventDispatcher] skip one lazy loading call [EventDispatcher] fix memory leak in a getListeners Default to stderr for console helpers (only merge if#15794 gets merged)
* 2.8: Added the right revision date for status code registry [Config] Fix enum default value in Yaml dumper fixed typo. [Translation][File dumper] allow get file content without writing in file. Finnish translation fix [CssSelector] Optimize regexs matching simple selectors Fix the phpdoc in the CssSelector TranslatorInterface [Console] Add clock mock to fix transient test on HHVM [DomCrawler] Optimize the regex used to find namespace prefixes [VarDumper] Add EnumStub for dumping virtual collections with casters [Finder] Deprecate adapters and related classes [EventDispatcher] skip one lazy loading call [EventDispatcher] fix memory leak in a getListeners [WebProfilerBundle] added btn-link. Remove duplication of the handling of regex filters in the Finder Default to stderr for console helpers (only merge if#15794 gets merged)Conflicts:src/Symfony/Component/Console/Tests/Helper/LegacyProgressHelperTest.phpsrc/Symfony/Component/EventDispatcher/EventDispatcher.phpsrc/Symfony/Component/VarDumper/Tests/CliDumperTest.phpsrc/Symfony/Component/VarDumper/Tests/HtmlDumperTest.php
keradus commentedFeb 6, 2016
Hi everyone ! |
alcohol commentedFeb 7, 2016
@keradus not sure, getting dusty? :d |
fabpot commentedMar 4, 2016
Thank you@alcohol. |
This PR was squashed before being merged into the 2.3 branch (closes#15794).Discussion----------[Console] default to stderr in the console helpersInteractive input/output and informational output such as progress should go to `stderr` if available.| Q | A| ------------- | ---| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets || License | MIT| Doc PR |See#13730 also for previous discussion.If someone explicitly wants to use `stdout`, they can simply pass `$output->getStream()` instead of `$output` in most use-cases.Commits-------3d4e95e [Console] default to stderr in the console helpers
* 2.8: Added the right revision date for status code registry [Config] Fix enum default value in Yaml dumper fixed typo. [Translation][File dumper] allow get file content without writing in file. Finnish translation fix [CssSelector] Optimize regexs matching simple selectors Fix the phpdoc in the CssSelector TranslatorInterface [Console] Add clock mock to fix transient test on HHVM [DomCrawler] Optimize the regex used to find namespace prefixes [VarDumper] Add EnumStub for dumping virtual collections with casters [Finder] Deprecate adapters and related classes [EventDispatcher] skip one lazy loading call [EventDispatcher] fix memory leak in a getListeners [WebProfilerBundle] added btn-link. Remove duplication of the handling of regex filters in the Finder Default to stderr for console helpers (only merge ifsymfony#15794 gets merged)Conflicts:src/Symfony/Component/Console/Tests/Helper/LegacyProgressHelperTest.phpsrc/Symfony/Component/EventDispatcher/EventDispatcher.phpsrc/Symfony/Component/VarDumper/Tests/CliDumperTest.phpsrc/Symfony/Component/VarDumper/Tests/HtmlDumperTest.php
Interactive input/output and informational output such as progress should go to
stderrif available.See#13730 also for previous discussion.
If someone explicitly wants to use
stdout, they can simply pass$output->getStream()instead of$outputin most use-cases.