1
0
Fork 0

Make sure getRepoConfig is only called on VcsRepos, refs #4700

pull/4525/merge
Jordi Boggiano 2016-01-09 18:01:48 +00:00
parent f874842535
commit 5dbc8fa30b
1 changed files with 7 additions and 3 deletions

View File

@ -14,6 +14,7 @@ namespace Composer\Downloader;
use Composer\Package\PackageInterface; use Composer\Package\PackageInterface;
use Composer\Util\Svn as SvnUtil; use Composer\Util\Svn as SvnUtil;
use Composer\Repository\VcsRepository;
/** /**
* @author Ben Bieker <mail@ben-bieker.de> * @author Ben Bieker <mail@ben-bieker.de>
@ -31,9 +32,12 @@ class SvnDownloader extends VcsDownloader
SvnUtil::cleanEnv(); SvnUtil::cleanEnv();
$ref = $package->getSourceReference(); $ref = $package->getSourceReference();
$repoConfig = $package->getRepository()->getRepoConfig(); $repo = $package->getRepository();
if (array_key_exists('svn-cache-credentials', $repoConfig)) { if ($repo instanceof VcsRepository) {
$this->cacheCredentials = (bool) $repoConfig['svn-cache-credentials']; $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->io->writeError(" Checking out ".$package->getSourceReference());