Make sure getRepoConfig is only called on VcsRepos, refs #4700
parent
f874842535
commit
5dbc8fa30b
|
@ -14,6 +14,7 @@ namespace Composer\Downloader;
|
|||
|
||||
use Composer\Package\PackageInterface;
|
||||
use Composer\Util\Svn as SvnUtil;
|
||||
use Composer\Repository\VcsRepository;
|
||||
|
||||
/**
|
||||
* @author Ben Bieker <mail@ben-bieker.de>
|
||||
|
@ -31,10 +32,13 @@ class SvnDownloader extends VcsDownloader
|
|||
SvnUtil::cleanEnv();
|
||||
$ref = $package->getSourceReference();
|
||||
|
||||
$repoConfig = $package->getRepository()->getRepoConfig();
|
||||
$repo = $package->getRepository();
|
||||
if ($repo instanceof VcsRepository) {
|
||||
$repoConfig = $repo->getRepoConfig();
|
||||
if (array_key_exists('svn-cache-credentials', $repoConfig)) {
|
||||
$this->cacheCredentials = (bool) $repoConfig['svn-cache-credentials'];
|
||||
}
|
||||
}
|
||||
|
||||
$this->io->writeError(" Checking out ".$package->getSourceReference());
|
||||
$this->execute($url, "svn co", sprintf("%s/%s", $url, $ref), null, $path);
|
||||
|
|
Loading…
Reference in New Issue