8000 [FrameworkBundle] Prevent silenced warning by checking if /proc/mount… · symfony/symfony@349b3e7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 349b3e7

Browse files
shyimnicolas-grekas
authored andcommitted
[FrameworkBundle] Prevent silenced warning by checking if /proc/mount exists
1 parent 837f7a8 commit 349b3e7

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php

+1-7
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ public function __construct(CacheClearerInterface $cacheClearer, ?Filesystem $fi
4949
$this->filesystem = $filesystem ?? new Filesystem();
5050
}
5151

52-
/**
53-
* {@inheritdoc}
54-
*/
5552
protected function configure()
5653
{
5754
$this
@@ -71,9 +68,6 @@ protected function configure()
7168
;
7269
}
7370

74-
/**
75-
* {@inheritdoc}
76-
*/
7771
protected function execute(InputInterface $input, OutputInterface $output): int
7872
{
7973
$fs = $this->filesystem;
@@ -208,7 +202,7 @@ private function isNfs(string $dir): bool
208202

209203
if (null === $mounts) {
210204
$mounts = [];
211-
if ('/' === \DIRECTORY_SEPARATOR && $files = @file('/proc/mounts')) {
205+
if ('/' === \DIRECTORY_SEPARATOR && is_readable('/proc/mounts') && $files = @file('/proc/mounts')) {
212206
foreach ($files as $mount) {
213207
$mount = \array_slice(explode(' ', $mount), 1, -3);
214208
if (!\in_array(array_pop($mount), ['vboxsf', 'nfs'])) {

0 commit comments

Comments
 (0)
0