fetchAllFromOperations() public method

public fetchAllFromOperations ( Composer\IO\IOInterface $io, Composer\Config $config, array $ops )
$io Composer\IO\IOInterface
$config Composer\Config
$ops array
Exemplo n.º 1
0
 public function testFetchAllWithInstallButFileExists()
 {
     list($opp, $pp) = $this->createProphecies();
     $pp->getName()->willReturn('');
     $pp->getDistType()->willReturn('html');
     $pp->getDistUrl()->willReturn('http://example.com/');
     $pp->getDistMirrors()->willReturn(array());
     $pp->getSourceUrl()->willReturn('git://uso800');
     $path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . FileDownloaderDummy::getCacheKeyCompat($pp->reveal(), 'http://example.com/');
     $fp = fopen($path, 'wb');
     $opp->getPackage()->willReturn($pp->reveal())->shouldBeCalled();
     $fetcher = new Prefetcher();
     $fetcher->fetchAllFromOperations($this->iop->reveal(), $this->configp->reveal(), array($opp->reveal()));
     fclose($fp);
     unlink($path);
 }
Exemplo n.º 2
0
 /**
  * pre-fetch parallel by curl_multi
  */
 public function onPostDependenciesSolving(Installer\InstallerEvent $ev)
 {
     if ($this->disabled) {
         return;
     }
     $prefetcher = new Prefetcher();
     $prefetcher->fetchAllFromOperations($this->io, $this->config, $ev->getOperations());
 }