1
0
Fork 0

Fix regression in loading Composer on SMB/network shares, refs #8231 #11077

pull/11150/head
Jordi Boggiano 2022-10-25 15:05:35 +02:00
parent 803e4e5dbd
commit 855473148a
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 3 additions and 2 deletions

View File

@ -13,6 +13,7 @@
namespace Composer\Json; namespace Composer\Json;
use Composer\Pcre\Preg; use Composer\Pcre\Preg;
use Composer\Util\Filesystem;
use JsonSchema\Validator; use JsonSchema\Validator;
use Seld\JsonLint\JsonParser; use Seld\JsonLint\JsonParser;
use Seld\JsonLint\ParsingException; use Seld\JsonLint\ParsingException;
@ -93,7 +94,7 @@ class JsonFile
if ($this->httpDownloader) { if ($this->httpDownloader) {
$json = $this->httpDownloader->get($this->path)->getBody(); $json = $this->httpDownloader->get($this->path)->getBody();
} else { } else {
if (!is_readable($this->path)) { if (!Filesystem::isReadable($this->path)) {
throw new \RuntimeException('The file "'.$this->path.'" is not readable.'); throw new \RuntimeException('The file "'.$this->path.'" is not readable.');
} }
if ($this->io && $this->io->isDebug()) { if ($this->io && $this->io->isDebug()) {
@ -193,7 +194,7 @@ class JsonFile
*/ */
public function validateSchema(int $schema = self::STRICT_SCHEMA, ?string $schemaFile = null): bool 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.'); throw new \RuntimeException('The file "'.$this->path.'" is not readable.');
} }
$content = file_get_contents($this->path); $content = file_get_contents($this->path);