From 4fc647983762c0b7b372b06b83a988b3b4ab90ea Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 25 Oct 2019 14:08:30 +0200 Subject: [PATCH] Fix require command to allow working on network mounts, fixes #8231 --- src/Composer/Command/RequireCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Composer/Command/RequireCommand.php b/src/Composer/Command/RequireCommand.php index 8f91b6675..1fa280d3f 100644 --- a/src/Composer/Command/RequireCommand.php +++ b/src/Composer/Command/RequireCommand.php @@ -99,7 +99,9 @@ EOT return 1; } - if (!is_readable($this->file)) { + // check for readability by reading the file as is_readable can not be trusted on network-mounts + // see https://github.com/composer/composer/issues/8231 and https://bugs.php.net/bug.php?id=68926 + if (!is_readable($this->file) && false === Silencer::call('file_get_contents', $this->file)) { $io->writeError(''.$this->file.' is not readable.'); return 1;