Skip to content
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

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

Merged
merged 1 commit into from Feb 6, 2024

Conversation

shyim
Copy link
Contributor

@shyim shyim commented Feb 5, 2024

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

cache:clear sometimes throws a warning as it tries to access /proc/mounts. This does not exist on macOS. Therefore I skipped that check completely for non linux systems.

Example output from the command line:
Screenshot 2024-02-04 at 18 34 30

@@ -204,6 +198,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int

private function isNfs(string $dir): bool
{
if ('Linux' !== \PHP_OS) {
Copy link
Member

Choose a reason for hiding this comment

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

on 7.1, we have this instead:

            if ('/' === \DIRECTORY_SEPARATOR && is_readable('/proc/mounts') && $files = @file('/proc/mounts')) {

@nicolas-grekas nicolas-grekas changed the title Remove warning accessing /proc/mounts on non Linux systems [FrameworkBundle] Prevent silenced warning by checking if /proc/mount exists Feb 6, 2024
@nicolas-grekas
Copy link
Member

Thank you @shyim.

@nicolas-grekas nicolas-grekas merged commit 354cc2c into symfony:5.4 Feb 6, 2024
6 of 11 checks passed
@shyim
Copy link
Contributor Author

shyim commented Feb 6, 2024

Ohh thanks for pushing into. was traveling.

@shyim shyim deleted the remove-warning-on-mac branch February 6, 2024 07:21
This was referenced Feb 27, 2024
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.

None yet

3 participants