Ensure diagnose command works even if provider-includes disappears
parent
41fb6146b0
commit
3604996464
|
@ -328,6 +328,7 @@ EOT
|
||||||
}
|
}
|
||||||
|
|
||||||
$json = $this->httpDownloader->get($protocol.'://repo.packagist.org/packages.json')->decodeJson();
|
$json = $this->httpDownloader->get($protocol.'://repo.packagist.org/packages.json')->decodeJson();
|
||||||
|
if (isset($json['provider-includes'])) {
|
||||||
$hash = reset($json['provider-includes']);
|
$hash = reset($json['provider-includes']);
|
||||||
$hash = $hash['sha256'];
|
$hash = $hash['sha256'];
|
||||||
$path = str_replace('%hash%', $hash, key($json['provider-includes']));
|
$path = str_replace('%hash%', $hash, key($json['provider-includes']));
|
||||||
|
@ -336,6 +337,7 @@ EOT
|
||||||
if (hash('sha256', $provider) !== $hash) {
|
if (hash('sha256', $provider) !== $hash) {
|
||||||
return '<warning>It seems that your proxy ('.$proxyStatus.') is modifying '.$protocol.' traffic on the fly</>';
|
return '<warning>It seems that your proxy ('.$proxyStatus.') is modifying '.$protocol.' traffic on the fly</>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return '<info>OK</> <comment>'.$proxyStatus.'</>';
|
return '<info>OK</> <comment>'.$proxyStatus.'</>';
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
Loading…
Reference in New Issue