From 855473148af3e8e7eabcad659644f0c99267ef76 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 25 Oct 2022 15:05:35 +0200 Subject: [PATCH] Fix regression in loading Composer on SMB/network shares, refs #8231 #11077 --- src/Composer/Json/JsonFile.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Composer/Json/JsonFile.php b/src/Composer/Json/JsonFile.php index 206ee662e..d4f851f8a 100644 --- a/src/Composer/Json/JsonFile.php +++ b/src/Composer/Json/JsonFile.php @@ -13,6 +13,7 @@ namespace Composer\Json; use Composer\Pcre\Preg; +use Composer\Util\Filesystem; use JsonSchema\Validator; use Seld\JsonLint\JsonParser; use Seld\JsonLint\ParsingException; @@ -93,7 +94,7 @@ class JsonFile if ($this->httpDownloader) { $json = $this->httpDownloader->get($this->path)->getBody(); } else { - if (!is_readable($this->path)) { + if (!Filesystem::isReadable($this->path)) { throw new \RuntimeException('The file "'.$this->path.'" is not readable.'); } if ($this->io && $this->io->isDebug()) { @@ -193,7 +194,7 @@ class JsonFile */ public function validateSchema(int $schema = self::STRICT_SCHEMA, ?string $schemaFile = null): bool { - if (!is_readable($this->path)) { + if (!Filesystem::isReadable($this->path)) { throw new \RuntimeException('The file "'.$this->path.'" is not readable.'); } $content = file_get_contents($this->path);