class Pool implements Countable (View source)

A package pool contains repositories that provide packages.

Constants

MATCH_NAME

MATCH_NONE

MATCH

MATCH_PROVIDE

MATCH_REPLACE

MATCH_FILTERED

Properties

protected $repositories
protected $providerRepos
protected $packages
protected $packageByName
protected $packageByExactName
protected $acceptableStabilities
protected $stabilityFlags
protected $versionParser
protected $providerCache
protected $filterRequires
protected $whitelist
protected $id

Methods

__construct($minimumStability = 'stable', array $stabilityFlags = array(), array $filterRequires = array())

No description

setWhitelist($whitelist)

No description

addRepository(RepositoryInterface $repo, array $rootAliases = array())

Adds a repository and its packages to this package pool

getPriority(RepositoryInterface $repo)

No description

packageById(int $id)

Retrieves the package object for a given package id.

count()

Returns how many packages have been loaded into the pool

whatProvides(string $name, ConstraintInterface $constraint = null, bool $mustMatchName = false, bool $bypassFilters = false)

Searches all packages providing the given package name and match the constraint

literalToPackage($literal)

No description

literalToPrettyString($literal, $installedMap)

No description

isPackageAcceptable($name, $stability)

No description

Details

__construct($minimumStability = 'stable', array $stabilityFlags = array(), array $filterRequires = array())

Parameters

$minimumStability
array $stabilityFlags
array $filterRequires

setWhitelist($whitelist)

Parameters

$whitelist

addRepository(RepositoryInterface $repo, array $rootAliases = array())

Adds a repository and its packages to this package pool

Parameters

RepositoryInterface $repo A package repository
array $rootAliases

getPriority(RepositoryInterface $repo)

Parameters

RepositoryInterface $repo

PackageInterface packageById(int $id)

Retrieves the package object for a given package id.

Parameters

int $id

Return Value

PackageInterface

count()

Returns how many packages have been loaded into the pool

PackageInterface[] whatProvides(string $name, ConstraintInterface $constraint = null, bool $mustMatchName = false, bool $bypassFilters = false)

Searches all packages providing the given package name and match the constraint

Parameters

string $name The package name to be searched for
ConstraintInterface $constraint A constraint that all returned packages must match or null to return all
bool $mustMatchName Whether the name of returned packages must match the given name
bool $bypassFilters If enabled, filterRequires and stability matching is ignored

Return Value

PackageInterface[] A set of packages

literalToPackage($literal)

Parameters

$literal

literalToPrettyString($literal, $installedMap)

Parameters

$literal
$installedMap

isPackageAcceptable($name, $stability)

Parameters

$name
$stability