1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 00:53:06 +00:00

fix config add/remove/unset/merge for bitbucket

This commit is contained in:
David Zuelke 2016-04-06 11:46:29 +02:00
parent 40c14709f7
commit cf43244f85
4 changed files with 21 additions and 25 deletions

View file

@ -85,12 +85,17 @@ abstract class BaseIO implements IOInterface
*/
public function loadConfiguration(Config $config)
{
$bitbucketOauth = $config->get('bitbucket-oauth') ?: array();
$githubOauth = $config->get('github-oauth') ?: array();
$gitlabOauth = $config->get('gitlab-oauth') ?: array();
$httpBasic = $config->get('http-basic') ?: array();
$bitbucketOauth = $config->get('bitbucket-oauth') ?: array();
// reload oauth token from config if available
// reload oauth tokens from config if available
foreach ($bitbucketOauth as $domain => $cred) {
$this->checkAndSetAuthentication($domain, $cred['consumer-key'], $cred['consumer-secret']);
}
foreach ($githubOauth as $domain => $token) {
if (!preg_match('{^[a-z0-9]+$}', $token)) {
throw new \UnexpectedValueException('Your github oauth token for '.$domain.' contains invalid characters: "'.$token.'"');
@ -107,10 +112,6 @@ abstract class BaseIO implements IOInterface
$this->checkAndSetAuthentication($domain, $cred['username'], $cred['password']);
}
foreach ($bitbucketOauth as $domain => $cred) {
$this->checkAndSetAuthentication($domain, $cred['consumer-key'], $cred['consumer-secret']);
}
// setup process timeout
ProcessExecutor::setTimeout((int) $config->get('process-timeout'));
}