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] Suppress unhandled error in some specific use-cases.#46291

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

Conversation

@rw4lll
Copy link
Contributor

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix #...
LicenseMIT
Doc PRsymfony/symfony-docs#...

If the package is used not in console with open_basedir enabled, since 5.4 it fails with unhandled php error here:
(https://github.com/symfony/console/blob/06974380c667d7d8e3cd0f24bf51f816a71ca6c6/Command/DumpCompletionCommand.php#L44) because of trying to call realpath("/") and, of course, it's not allowed.

It's a very specific use-case for Symfony, but can happen if it's used as dependency, e.g. in Laravel. I've described it in details here:laravel/framework#42171

I think that the best would be just suppress the error in that case.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has acontribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 6.1 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbot
Copy link

Hey!

I think@dkarlovi has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@dkarlovi
Copy link
Contributor

@rw4lll reading the related Laravel issue, you mention this happens when the command is invoked in web context? That should basically never happen. If it does, it should be up to the invoker (I guess, Artisan?) to handle these issues on its side, maybe by introducing a custom error handler or similar?

In any case, I'm 👎 here.

Copy link
Member

@wouterjwouterj left a comment

Choose a reason for hiding this comment

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

Hi. Thanks for the PR.

Given this is a default command, andconfigure() is called automatically when instantiating theApplication, I agree that suppressing the error is the best way forward. Otherwise, any user of the Console component will have this error when usingopen_basedir.


For reference, Symfony overrides the Application class from the component in the FrameworkBundle and uses lazy loading of all commands. This means that in a Symfony application,configure() is only called when the command is called. This means that it is indeed unlikely to get this error when using the Symfony full-stack framework.

derrabus and rw4lll reacted with thumbs up emoji
@carsonbotcarsonbot changed the titleSuppress unhandled error in some specific use-cases.[Console] Suppress unhandled error in some specific use-cases.May 9, 2022
@nicolas-grekas
Copy link
Member

Thank you@rw4lll.

@nicolas-grekasnicolas-grekas merged commit60836ff intosymfony:5.4May 10, 2022
@fabpotfabpot mentioned this pull requestMay 14, 2022
This was referencedMay 27, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@wouterjwouterjwouterj approved these changes

@derrabusderrabusderrabus approved these changes

@chalasrchalasrAwaiting requested review from chalasrchalasr is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

6 participants

@rw4lll@carsonbot@dkarlovi@nicolas-grekas@wouterj@derrabus

[8]ページ先頭

©2009-2025 Movatter.jp