Debug info improvements

main
Jordi Boggiano 4 years ago
parent 378a5b72b9
commit eb9616a82b
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -190,7 +190,7 @@ EOT
);
} catch (\Exception $e) {
if ($this->newlyCreated) {
throw new \RuntimeException('No composer.json present in the current directory, this may be the cause of the following exception.', 0, $e);
throw new \RuntimeException('No composer.json present in the current directory ('.$this->file.'), this may be the cause of the following exception.', 0, $e);
}
throw $e;

@ -315,7 +315,7 @@ class Factory
$config = static::createConfig($io, $cwd);
$config->merge($localConfig);
if (isset($composerFile)) {
$io->writeError('Loading config file ' . $composerFile, true, IOInterface::DEBUG);
$io->writeError('Loading config file ' . $composerFile .' ('.realpath($composerFile).')', true, IOInterface::DEBUG);
$config->setConfigSource(new JsonConfigSource(new JsonFile(realpath($composerFile), null, $io)));
$localAuthFile = new JsonFile(dirname(realpath($composerFile)) . '/auth.json', null, $io);

@ -90,7 +90,12 @@ class JsonFile
$json = $this->httpDownloader->get($this->path)->getBody();
} else {
if ($this->io && $this->io->isDebug()) {
$this->io->writeError('Reading ' . $this->path);
$realpathInfo = '';
$realpath = realpath($this->path);
if (false !== $realpath && $realpath !== $this->path) {
$realpathInfo = ' (' . $realpath . ')';
}
$this->io->writeError('Reading ' . $this->path . $realpathInfo);
}
$json = file_get_contents($this->path);
}

Loading…
Cancel
Save