Skip to content

[FrameworkBundle] Prevent silenced warning by checking if /proc/mount exists #53138

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

Merged
merged 1 commit into from
Dec 30, 2023

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Dec 19, 2023

Q A
Branch? 7.1
Bug fix? yes
New feature? no
Deprecations? no
Issues -
License MIT

When running bin/console cache:clear -vvv on Mac OS, I get the following warning:

12:40:51 DEBUG     [php] Warning: file(/proc/mounts): Failed to open stream: No such file or directory
[
  "exception" => Symfony\Component\ErrorHandler\Exception\SilencedErrorContext {
    +count: 1
    -severity: E_WARNING
    trace: {
      ./vendor/symfony/framework-bundle/Command/CacheClearCommand.php:203 { …}
      ./vendor/symfony/framework-bundle/Command/CacheClearCommand.php:156 { …}
    }
  }
]

This warning can be avoided by checking whether the file exists. Maybe the @ can be removed also.

I'm not sure about the branch to target as this is not really a bug.

@GromNaN GromNaN added this to the 7.1 milestone Dec 19, 2023
@carsonbot carsonbot changed the title Prevent silenced warning by checking if file exists [FrameworkBundle] Prevent silenced warning by checking if file exists Dec 19, 2023
@carsonbot carsonbot added the Bug label Dec 19, 2023
@GromNaN GromNaN changed the title [FrameworkBundle] Prevent silenced warning by checking if file exists [FrameworkBundle] Prevent silenced warning by checking if /proc/mount exists Dec 19, 2023
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

GTM but you must have xdebug enabled: silenced calls shouldn't be reported.

@nicolas-grekas
Copy link
Member

Thank you @GromNaN.

@nicolas-grekas nicolas-grekas merged commit ccbdc1a into symfony:7.1 Dec 30, 2023
@GromNaN GromNaN deleted the cc-proc branch December 30, 2023 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants