Simplify envvar credential parsing
parent
e9cac53f90
commit
aaee6dc0b0
|
@ -209,8 +209,7 @@ class RemoteFilesystem
|
||||||
|
|
||||||
// Use COMPOSER_AUTH environment variable if set
|
// Use COMPOSER_AUTH environment variable if set
|
||||||
if (getenv('COMPOSER_AUTH')) {
|
if (getenv('COMPOSER_AUTH')) {
|
||||||
$credentials = [];
|
$credentials = explode(':', getenv('COMPOSER_AUTH'), 2);
|
||||||
preg_match('/(.+):(.+)/', getenv('COMPOSER_AUTH'), $credentials);
|
|
||||||
|
|
||||||
if (count($credentials) === 2) {
|
if (count($credentials) === 2) {
|
||||||
$this->io->setAuthentication($originUrl, $credentials[0], $credentials[1]);
|
$this->io->setAuthentication($originUrl, $credentials[0], $credentials[1]);
|
||||||
|
|
Loading…
Reference in New Issue