Add hard failure if COMPOSER_AUTH is malformed json, fixes #11085
parent
06359da3a3
commit
2c1b309cd3
|
@ -219,9 +219,7 @@ class Factory
|
||||||
if ($composerAuthEnv = Platform::getEnv('COMPOSER_AUTH')) {
|
if ($composerAuthEnv = Platform::getEnv('COMPOSER_AUTH')) {
|
||||||
$authData = json_decode($composerAuthEnv);
|
$authData = json_decode($composerAuthEnv);
|
||||||
if (null === $authData) {
|
if (null === $authData) {
|
||||||
if ($io instanceof IOInterface) {
|
throw new \UnexpectedValueException('COMPOSER_AUTH environment variable is malformed, should be a valid JSON object');
|
||||||
$io->writeError('<error>COMPOSER_AUTH environment variable is malformed, should be a valid JSON object</error>');
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if ($io instanceof IOInterface) {
|
if ($io instanceof IOInterface) {
|
||||||
$io->writeError('Loading auth config from COMPOSER_AUTH', true, IOInterface::DEBUG);
|
$io->writeError('Loading auth config from COMPOSER_AUTH', true, IOInterface::DEBUG);
|
||||||
|
|
Loading…
Reference in New Issue