function Svn::createAuthFromConfig
Create the auth params from the configuration file.
1 call to Svn::createAuthFromConfig()
- Svn::hasAuth in vendor/
composer/ composer/ src/ Composer/ Util/ Svn.php - Detect Svn Auth.
File
-
vendor/
composer/ composer/ src/ Composer/ Util/ Svn.php, line 313
Class
- Svn
- @author Till Klampaeckel <till@php.net> @author Jordi Boggiano <j.boggiano@seld.be>
Namespace
Composer\UtilCode
private function createAuthFromConfig() : bool {
if (!$this->config
->has('http-basic')) {
return $this->hasAuth = false;
}
$authConfig = $this->config
->get('http-basic');
$host = parse_url($this->url, PHP_URL_HOST);
if (isset($authConfig[$host])) {
$this->credentials = [
'username' => $authConfig[$host]['username'],
'password' => $authConfig[$host]['password'],
];
return $this->hasAuth = true;
}
return $this->hasAuth = false;
}