Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Console] Reset question validator attempts only for actual stdin (bis)#37286

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

Merged
nicolas-grekas merged 1 commit intosymfony:4.4fromnicolas-grekas:console-stdin
Jun 15, 2020

Conversation

@nicolas-grekas
Copy link
Member

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

#37160fails, this should fix it by looking at the actual input stream.

if (!\defined('STDIN')) {
$inputStream =$this->inputStream ?:fopen('php://stdin','r');

if ('php://stdin' !== (stream_get_meta_data($inputStream)['url'] ??null)) {
Copy link
MemberAuthor

@nicolas-grekasnicolas-grekasJun 15, 2020
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

actually this is not needed to fix the failure, but making the behavior of this method global looks suspicious to me so here is a local check

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

note that this check works even if$inputStream === STDIN

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Are you sure withurl here?

>>> stream_get_meta_data(STDIN)['url']PHP Notice:  Undefined index: url in phar://eval()'d code on line 1=> null>>> stream_get_meta_data(STDIN)=> [     "timed_out" => false,     "blocked" => true,     "eof" => false,     "wrapper_type" => "PHP",     "stream_type" => "STDIO",     "mode" => "rb",     "unread_bytes" => 0,     "seekable" => false,     "uri" => "php://stdin",   ]

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Pretty much yes:https://3v4l.org/njZZV
What's your runtime?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

That 3v4l snippet follows behaviour I observe on my PC, it looks to beuri, noturl

chalasr reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

🤦


if (\function_exists('stream_isatty')) {
returnstream_isatty(fopen('php://input','r'));
returnstream_isatty($inputStream);
Copy link
MemberAuthor

@nicolas-grekasnicolas-grekasJun 15, 2020
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

this was my mistake: usingphp://stdin here instead is enough to fix the failure

ostrolucky reacted with thumbs up emoji
@nicolas-grekasnicolas-grekas merged commit943c630 intosymfony:4.4Jun 15, 2020
@nicolas-grekasnicolas-grekas deleted the console-stdin branchJune 18, 2020 17:54
weaverryan added a commit to symfony/maker-bundle that referenced this pull requestJul 6, 2020
… (weaverryan)This PR was squashed before being merged into the 1.0-dev branch.Discussion----------using stable-dev in tests to get latest fixes from SymfonyThis avoids a behavior change insymfony/console@6f533d9...d2c9f77 fromsymfony/symfony#37286I'll create a PR to revert this after merge, which we will merge once the issue is resolved.Commits-------1309c01 updating test in one other spotccfd248 forcing stable ORM in tests6b512b8 making migration test work in all versionsb5a5a11 phpcs6af124a Guaranteeing that dev versions will get dev dependenciesfd89d5d Forcing "stable" for 7.173f9ecc updating test for new version of migrations0334718 Using stable-dev as default version in tests
This was referencedJul 24, 2020
saylor-mik87786 added a commit to saylor-mik87786/maker-bundle that referenced this pull requestJun 3, 2025
… (weaverryan)This PR was squashed before being merged into the 1.0-dev branch.Discussion----------using stable-dev in tests to get latest fixes from SymfonyThis avoids a behavior change insymfony/console@6f533d9...d2c9f77 fromsymfony/symfony#37286I'll create a PR to revert this after merge, which we will merge once the issue is resolved.Commits-------1309c01 updating test in one other spotccfd248 forcing stable ORM in tests6b512b8 making migration test work in all versionsb5a5a11 phpcs6af124a Guaranteeing that dev versions will get dev dependenciesfd89d5d Forcing "stable" for 7.173f9ecc updating test for new version of migrations0334718 Using stable-dev as default version in tests
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@chalasrchalasrchalasr approved these changes

+1 more reviewer

@ostroluckyostroluckyostrolucky left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

4 participants

@nicolas-grekas@ostrolucky@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp