function SvnDriver::initialize
@inheritDoc
Overrides VcsDriverInterface::initialize
File
-
vendor/
composer/ composer/ src/ Composer/ Repository/ Vcs/ SvnDriver.php, line 60
Class
- SvnDriver
- @author Jordi Boggiano <j.boggiano@seld.be> @author Till Klampaeckel <till@php.net>
Namespace
Composer\Repository\VcsCode
public function initialize() : void {
$this->url = $this->baseUrl = rtrim(self::normalizeUrl($this->url), '/');
SvnUtil::cleanEnv();
if (isset($this->repoConfig['trunk-path'])) {
$this->trunkPath = $this->repoConfig['trunk-path'];
}
if (isset($this->repoConfig['branches-path'])) {
$this->branchesPath = $this->repoConfig['branches-path'];
}
if (isset($this->repoConfig['tags-path'])) {
$this->tagsPath = $this->repoConfig['tags-path'];
}
if (array_key_exists('svn-cache-credentials', $this->repoConfig)) {
$this->cacheCredentials = (bool) $this->repoConfig['svn-cache-credentials'];
}
if (isset($this->repoConfig['package-path'])) {
$this->packagePath = '/' . trim($this->repoConfig['package-path'], '/');
}
if (false !== ($pos = strrpos($this->url, '/' . $this->trunkPath))) {
$this->baseUrl = substr($this->url, 0, $pos);
}
$this->cache = new Cache($this->io, $this->config
->get('cache-repo-dir') . '/' . Preg::replace('{[^a-z0-9.]}i', '-', Url::sanitize($this->baseUrl)));
$this->cache
->setReadOnly($this->config
->get('cache-read-only'));
$this->getBranches();
$this->getTags();
}