1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-11 01:22:54 +00:00

Add COMPOSER_DISABLE_NETWORK env var for debugging

This commit is contained in:
Jordi Boggiano 2018-12-04 11:36:15 +01:00
parent e8c6948770
commit fc03ab9bba
3 changed files with 26 additions and 1 deletions

View file

@ -1044,7 +1044,12 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
return false;
}
if (--$retries) {
// special error code returned when network is being artificially disabled
if ($e instanceof TransportException && $e->getStatusCode() === 499) {
$retries = 0;
}
if (--$retries > 0) {
usleep(100000);
return $httpDownloader->add($filename, $options)->then($accept, $reject);