1
0
Fork 0

Merge pull request #2153 from renanbr/archive-prefer-dist

prefer-dist and archive synchronized
pull/2172/merge
Nils Adermann 2013-08-16 06:41:02 -07:00
commit c6aa97ed8a
3 changed files with 16 additions and 2 deletions

View File

@ -68,7 +68,8 @@ EOT
{
$config = Factory::createConfig();
$factory = new Factory;
$archiveManager = $factory->createArchiveManager($config);
$downloadManager = $factory->createDownloadManager($io, $config);
$archiveManager = $factory->createArchiveManager($config, $downloadManager);
if ($packageName) {
$package = $this->selectPackage($io, $packageName, $version);

View File

@ -316,6 +316,19 @@ class Factory
}
$dm = new Downloader\DownloadManager();
switch ($config->get('preferred-install')) {
case 'dist':
$dm->setPreferDist(true);
break;
case 'source':
$dm->setPreferSource(true);
break;
case 'auto':
default:
// noop
break;
}
$dm->setDownloader('git', new Downloader\GitDownloader($io, $config));
$dm->setDownloader('svn', new Downloader\SvnDownloader($io, $config));
$dm->setDownloader('hg', new Downloader\HgDownloader($io, $config));

View File

@ -138,7 +138,7 @@ class ArchiveManager
$filesystem->ensureDirectoryExists($sourcePath);
// Download sources
$this->downloadManager->download($package, $sourcePath, true);
$this->downloadManager->download($package, $sourcePath);
}
// Create the archive