1
0
Fork 0

Remote outputProgress concept from downloaders as it does not make sense when things happen in parallel, refs #7901

pull/7904/head
Jordi Boggiano 2019-01-18 11:48:51 +01:00
parent ea978ee7f8
commit 549ccd8f79
9 changed files with 1 additions and 55 deletions

View File

@ -162,7 +162,6 @@ EOT
}
$composer = Factory::create($io, null, $disablePlugins);
$composer->getDownloadManager()->setOutputProgress(!$noProgress);
$fs = new Filesystem();
@ -351,8 +350,7 @@ EOT
$httpDownloader = $factory->createHttpDownloader($io, $config);
$dm = $factory->createDownloadManager($io, $config, $httpDownloader);
$dm->setPreferSource($preferSource)
->setPreferDist($preferDist)
->setOutputProgress(!$noProgress);
->setPreferDist($preferDist);
$projectInstaller = new ProjectInstaller($directory, $dm);
$im = $factory->createInstallationManager(new Loop($httpDownloader));

View File

@ -85,7 +85,6 @@ EOT
}
$composer = $this->getComposer(true, $input->getOption('no-plugins'));
$composer->getDownloadManager()->setOutputProgress(!$input->getOption('no-progress'));
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'install', $input, $output);
$composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);

View File

@ -126,7 +126,6 @@ EOT
// Update packages
$this->resetComposer();
$composer = $this->getComposer(true, $input->getOption('no-plugins'));
$composer->getDownloadManager()->setOutputProgress(!$input->getOption('no-progress'));
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'remove', $input, $output);
$composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);

View File

@ -167,7 +167,6 @@ EOT
// Update packages
$this->resetComposer();
$composer = $this->getComposer(true, $input->getOption('no-plugins'));
$composer->getDownloadManager()->setOutputProgress(!$input->getOption('no-progress'));
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'require', $input, $output);
$composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);

View File

@ -120,8 +120,6 @@ EOT
}
}
$composer->getDownloadManager()->setOutputProgress(!$input->getOption('no-progress'));
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'update', $input, $output);
$composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);

View File

@ -85,22 +85,6 @@ class DownloadManager
return $this;
}
/**
* Sets whether to output download progress information for all registered
* downloaders
*
* @param bool $outputProgress
* @return DownloadManager
*/
public function setOutputProgress($outputProgress)
{
foreach ($this->downloaders as $downloader) {
$downloader->setOutputProgress($outputProgress);
}
return $this;
}
/**
* Sets installer downloader for a specific installation type.
*

View File

@ -61,12 +61,4 @@ interface DownloaderInterface
* @param string $path download path
*/
public function remove(PackageInterface $package, $path);
/**
* Sets whether to output download progress information or not
*
* @param bool $outputProgress
* @return DownloaderInterface
*/
public function setOutputProgress($outputProgress);
}

View File

@ -43,7 +43,6 @@ class FileDownloader implements DownloaderInterface, ChangeReportInterface
protected $httpDownloader;
protected $filesystem;
protected $cache;
protected $outputProgress = true;
/**
* @private this is only public for php 5.3 support in closures
*/
@ -236,16 +235,6 @@ class FileDownloader implements DownloaderInterface, ChangeReportInterface
$this->filesystem->rename($this->getFileName($package, $path), $path . pathinfo(parse_url($package->getDistUrl(), PHP_URL_PATH), PATHINFO_BASENAME));
}
/**
* {@inheritDoc}
*/
public function setOutputProgress($outputProgress)
{
$this->outputProgress = $outputProgress;
return $this;
}
/**
* TODO mark private in v3
* @protected This is public due to PHP 5.3
@ -340,11 +329,9 @@ class FileDownloader implements DownloaderInterface, ChangeReportInterface
public function getLocalChanges(PackageInterface $package, $targetDir)
{
$prevIO = $this->io;
$prevProgress = $this->outputProgress;
$this->io = new NullIO;
$this->io->loadConfiguration($this->config);
$this->outputProgress = false;
$e = null;
try {
@ -362,7 +349,6 @@ class FileDownloader implements DownloaderInterface, ChangeReportInterface
}
$this->io = $prevIO;
$this->outputProgress = $prevProgress;
if ($e) {
throw $e;

View File

@ -210,15 +210,6 @@ abstract class VcsDownloader implements DownloaderInterface, ChangeReportInterfa
}
}
/**
* Download progress information is not available for all VCS downloaders.
* {@inheritDoc}
*/
public function setOutputProgress($outputProgress)
{
return $this;
}
/**
* {@inheritDoc}
*/