Merge pull request #2153 from renanbr/archive-prefer-dist
prefer-dist and archive synchronizedpull/2172/merge
commit
c6aa97ed8a
|
@ -68,7 +68,8 @@ EOT
|
||||||
{
|
{
|
||||||
$config = Factory::createConfig();
|
$config = Factory::createConfig();
|
||||||
$factory = new Factory;
|
$factory = new Factory;
|
||||||
$archiveManager = $factory->createArchiveManager($config);
|
$downloadManager = $factory->createDownloadManager($io, $config);
|
||||||
|
$archiveManager = $factory->createArchiveManager($config, $downloadManager);
|
||||||
|
|
||||||
if ($packageName) {
|
if ($packageName) {
|
||||||
$package = $this->selectPackage($io, $packageName, $version);
|
$package = $this->selectPackage($io, $packageName, $version);
|
||||||
|
|
|
@ -316,6 +316,19 @@ class Factory
|
||||||
}
|
}
|
||||||
|
|
||||||
$dm = new Downloader\DownloadManager();
|
$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('git', new Downloader\GitDownloader($io, $config));
|
||||||
$dm->setDownloader('svn', new Downloader\SvnDownloader($io, $config));
|
$dm->setDownloader('svn', new Downloader\SvnDownloader($io, $config));
|
||||||
$dm->setDownloader('hg', new Downloader\HgDownloader($io, $config));
|
$dm->setDownloader('hg', new Downloader\HgDownloader($io, $config));
|
||||||
|
|
|
@ -138,7 +138,7 @@ class ArchiveManager
|
||||||
$filesystem->ensureDirectoryExists($sourcePath);
|
$filesystem->ensureDirectoryExists($sourcePath);
|
||||||
|
|
||||||
// Download sources
|
// Download sources
|
||||||
$this->downloadManager->download($package, $sourcePath, true);
|
$this->downloadManager->download($package, $sourcePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the archive
|
// Create the archive
|
||||||
|
|
Loading…
Reference in New Issue