Remove async repo interface, closes #7902
parent
f2058680a7
commit
d12c20db4b
|
@ -16,7 +16,6 @@ use Composer\Package\AliasPackage;
|
||||||
use Composer\Package\BasePackage;
|
use Composer\Package\BasePackage;
|
||||||
use Composer\Package\Package;
|
use Composer\Package\Package;
|
||||||
use Composer\Package\PackageInterface;
|
use Composer\Package\PackageInterface;
|
||||||
use Composer\Repository\AsyncRepositoryInterface;
|
|
||||||
use Composer\Repository\ComposerRepository;
|
use Composer\Repository\ComposerRepository;
|
||||||
use Composer\Repository\InstalledRepositoryInterface;
|
use Composer\Repository\InstalledRepositoryInterface;
|
||||||
use Composer\Repository\PlatformRepository;
|
use Composer\Repository\PlatformRepository;
|
||||||
|
@ -87,13 +86,6 @@ class PoolBuilder
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!empty($loadNames)) {
|
while (!empty($loadNames)) {
|
||||||
$loadIds = array();
|
|
||||||
foreach ($repositories as $key => $repository) {
|
|
||||||
if ($repository instanceof AsyncRepositoryInterface) {
|
|
||||||
$loadIds[$key] = $repository->requestPackages($loadNames);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($loadNames as $name => $void) {
|
foreach ($loadNames as $name => $void) {
|
||||||
$this->loadedNames[$name] = true;
|
$this->loadedNames[$name] = true;
|
||||||
}
|
}
|
||||||
|
@ -104,13 +96,8 @@ class PoolBuilder
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($repository instanceof AsyncRepositoryInterface) {
|
|
||||||
// TODO ispackageacceptablecallable in here?
|
|
||||||
$packages = $repository->returnPackages($loadIds[$key]);
|
|
||||||
} else {
|
|
||||||
// TODO should we really pass the callable into here?
|
// TODO should we really pass the callable into here?
|
||||||
$packages = $repository->loadPackages($loadNames, $this->isPackageAcceptableCallable);
|
$packages = $repository->loadPackages($loadNames, $this->isPackageAcceptableCallable);
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($packages as $package) {
|
foreach ($packages as $package) {
|
||||||
if (call_user_func($this->isPackageAcceptableCallable, $package->getNames(), $package->getStability())) {
|
if (call_user_func($this->isPackageAcceptableCallable, $package->getNames(), $package->getStability())) {
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is part of Composer.
|
|
||||||
*
|
|
||||||
* (c) Nils Adermann <naderman@naderman.de>
|
|
||||||
* Jordi Boggiano <j.boggiano@seld.be>
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Composer\Repository;
|
|
||||||
|
|
||||||
use Composer\Package\PackageInterface;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Repository interface.
|
|
||||||
*
|
|
||||||
* @author Nils Adermann <naderman@naderman.de>
|
|
||||||
* @author Konstantin Kudryashov <ever.zet@gmail.com>
|
|
||||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
|
||||||
*/
|
|
||||||
interface AsyncRepositoryInterface
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @param array $names Names of packages to retrieve data for
|
|
||||||
* @return mixed Id to be passed to later loadPackages call
|
|
||||||
*/
|
|
||||||
public function requestPackages(array $names);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param array $names
|
|
||||||
* @return mixed id for load call
|
|
||||||
*/
|
|
||||||
public function returnPackages($loadId);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue