Skip to content

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

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
Feb 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[FrameworkBundle] Prevent silenced warning by checking if /proc/mount…
… exists
  • Loading branch information
shyim authored and nicolas-grekas committed Feb 6, 2024
commit 349b3e70d38d7da2ac499eb594a54877adc1700e
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ public function __construct(CacheClearerInterface $cacheClearer, ?Filesystem $fi
$this->filesystem = $filesystem ?? new Filesystem();
}

/**
* {@inheritdoc}
*/
protected function configure()
{
$this
Expand All @@ -71,9 +68,6 @@ protected function configure()
;
}

/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$fs = $this->filesystem;
Expand Down Expand Up @@ -208,7 +202,7 @@ private function isNfs(string $dir): bool

if (null === $mounts) {
$mounts = [];
if ('/' === \DIRECTORY_SEPARATOR && $files = @file('/proc/mounts')) {
if ('/' === \DIRECTORY_SEPARATOR && is_readable('/proc/mounts') && $files = @file('/proc/mounts')) {
foreach ($files as $mount) {
$mount = \array_slice(explode(' ', $mount), 1, -3);
if (!\in_array(array_pop($mount), ['vboxsf', 'nfs'])) {
Expand Down