1
0
Fork 0

Add support for info/warnings in every json file loaded by ComposerRepo

pull/6236/head
Jordi Boggiano 2017-03-08 14:10:50 +01:00
parent 001fe8afcf
commit 11ce391222
1 changed files with 14 additions and 4 deletions

View File

@ -502,10 +502,6 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
}
}
if (!empty($data['warning'])) {
$this->io->writeError('<warning>Warning from '.$this->url.': '.$data['warning'].'</warning>');
}
if (!empty($data['providers-lazy-url'])) {
$this->lazyProvidersUrl = $this->canonicalizeUrl($data['providers-lazy-url']);
$this->hasProviders = true;
@ -682,6 +678,13 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
}
$data = JsonFile::parseJson($json, $filename);
if (!empty($data['warning'])) {
$this->io->writeError('<warning>Warning from '.$this->url.': '.$data['warning'].'</warning>');
}
if (!empty($data['info'])) {
$this->io->writeError('<info>Info from '.$this->url.': '.$data['info'].'</info>');
}
if ($cacheKey) {
if ($storeLastModifiedTime) {
$lastModifiedDate = $rfs->findHeaderValue($rfs->getLastHeaders(), 'last-modified');
@ -745,6 +748,13 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
}
$data = JsonFile::parseJson($json, $filename);
if (!empty($data['warning'])) {
$this->io->writeError('<warning>Warning from '.$this->url.': '.$data['warning'].'</warning>');
}
if (!empty($data['info'])) {
$this->io->writeError('<info>Info from '.$this->url.': '.$data['info'].'</info>');
}
$lastModifiedDate = $rfs->findHeaderValue($rfs->getLastHeaders(), 'last-modified');
if ($lastModifiedDate) {
$data['last-modified'] = $lastModifiedDate;