Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Console] Constant STDOUT might be undefined#34344
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
1b564cb
todd79978
CompareThere 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.
fopen('php://stdout', 'w')?
Would be overkill here. The constant is defined by the CLI SAPI. Thus, if the constant is not there, we're not on CLI, thus we're not on a terminal with VT100 support. We already have a similar check in PhpUnitBridge: symfony/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php Lines 355 to 357 infb4065a
|
I'm not sure I agree. If the check targets the sapi, let's make it crystal clear. Checks for color support all use php://stdout. STDOUT is not used anywhere else in the codebase as far as I checked. I think we should check what we want to check in a portable way, using php://stdout Sorry my previous comment was too laconic. |
Well yes, the method I've linked in my previous comment uses the constant to check for color support as well. symfony/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php Lines 353 to 383 infb4065a
Also, I wouldn't want to change the way stdout is accessed without a Windows machine to test on. 😕 |
That's the bridge, it's not a piece of reusability, it's a tool :) |
dd79978
toe1bfb48
CompareAll right, here you go. @lazosweb Can you please test again? Sorry for the hassle. 😃 |
lazosweb commentedNov 13, 2019
@derrabus . All good. No issue. That will work too. |
Should be merged after#34346 and rebased on 3.4. |
e1bfb48
to4225009
Compare4225009
tobb8c82c
CompareThis PR was merged into the 3.4 branch.Discussion----------[Console] Constant STDOUT might be undefined| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets |Fix#34341| License | MIT| Doc PR | N/ACommits-------bb8c82c [Console] Constant STDOUT might be undefined.
Thank you@derrabus |
Uh oh!
There was an error while loading.Please reload this page.