mirror of
https://github.com/composer/composer
synced 2025-05-10 17:12:51 +00:00
Rename findPackagesByName to findPackages and allow version arg
This commit is contained in:
parent
afbb9cefa4
commit
5eb333680b
7 changed files with 63 additions and 36 deletions
|
@ -50,6 +50,25 @@ class RepositoryManager
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Searches for all packages matching a name and optionally a version in managed repositories.
|
||||
*
|
||||
* @param string $name package name
|
||||
* @param string $version package version
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function findPackages($name, $version)
|
||||
{
|
||||
$packages = array();
|
||||
|
||||
foreach ($this->repositories as $repository) {
|
||||
$packages = array_merge($packages, $repository->findPackages($name, $version));
|
||||
}
|
||||
|
||||
return $packages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds repository
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue