class ComposerRepository extends ArrayRepository implements ConfigurableRepositoryInterface (View source)

Properties

protected PackageInterface[] $packages from ArrayRepository
protected $config
protected $repoConfig
protected $options
protected $url
protected $baseUrl
protected $io
protected $rfs
protected $cache
protected $notifyUrl
protected $searchUrl
protected $hasProviders
protected $providersUrl
protected $lazyProvidersUrl
protected $providerListing
protected $providers
protected $providersByUid
protected $loader
protected $rootAliases
protected $allowSslDowngrade
protected $eventDispatcher
protected $sourceMirrors
protected $distMirrors

Methods

array
getDependents(string|string[] $needle, ConstraintInterface|null $constraint = null, bool $invert = false, bool $recurse = true, string[] $packagesFound = null)

Returns a list of links causing the requested needle packages to be installed, as an associative array with the dependent's name as key, and an array containing in order the PackageInterface and Link describing the relationship as values. If recursive lookup was requested a third value is returned containing an identically formed array up to the root package. That third value will be false in case a circular recursion was detected.

__construct(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, RemoteFilesystem $rfs = null)

No description

findPackage(string $name, string|ConstraintInterface $constraint)

Searches for the first match of a package by name and version.

findPackages(string $name, string|ConstraintInterface $constraint = null)

Searches for all packages matching a name and optionally a version.

array[]
search(string $query, int $mode = 0, $type = null)

Searches the repository for packages containing the query

bool
hasPackage(PackageInterface $package)

Checks if specified package registered (installed).

addPackage(PackageInterface $package)

Adds a new package to the repository

createAliasPackage(PackageInterface $package, $alias, $prettyAlias)

No description

removePackage(PackageInterface $package)

Removes package from repository.

getPackages()

Returns list of registered packages.

int
count()

Returns the number of packages in this repository

initialize()

Initializes the packages array. Mostly meant as an extension point.

getRepoConfig()

No description

setRootAliases(array $rootAliases)

No description

getProviderNames()

No description

hasProviders()

No description

resetPackageIds()

No description

array|mixed
whatProvides(Pool $pool, string $name, bool $bypassFilters = false)

No description

loadRootServerFile()

No description

canonicalizeUrl($url)

No description

loadDataFromServer()

No description

loadProviderListings($data)

No description

loadIncludes($data)

No description

createPackage(array $data, $class = 'Composer\\Package\\CompletePackage')

No description

fetchFile($filename, $cacheKey = null, $sha256 = null, $storeLastModifiedTime = false)

No description

fetchFileIfLastModified($filename, $cacheKey, $lastModifiedTime)

No description

Details

array getDependents(string|string[] $needle, ConstraintInterface|null $constraint = null, bool $invert = false, bool $recurse = true, string[] $packagesFound = null)

Returns a list of links causing the requested needle packages to be installed, as an associative array with the dependent's name as key, and an array containing in order the PackageInterface and Link describing the relationship as values. If recursive lookup was requested a third value is returned containing an identically formed array up to the root package. That third value will be false in case a circular recursion was detected.

Parameters

string|string[] $needle The package name(s) to inspect.
ConstraintInterface|null $constraint Optional constraint to filter by.
bool $invert Whether to invert matches to discover reasons for the package NOT to be installed.
bool $recurse Whether to recursively expand the requirement tree up to the root package.
string[] $packagesFound Used internally when recurring

Return Value

array An associative array of arrays as described above.

__construct(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, RemoteFilesystem $rfs = null)

Parameters

array $repoConfig
IOInterface $io
Config $config
EventDispatcher $eventDispatcher
RemoteFilesystem $rfs

PackageInterface|null findPackage(string $name, string|ConstraintInterface $constraint)

Searches for the first match of a package by name and version.

Parameters

string $name package name
string|ConstraintInterface $constraint package version or version constraint to match against

Return Value

PackageInterface|null

PackageInterface[] findPackages(string $name, string|ConstraintInterface $constraint = null)

Searches for all packages matching a name and optionally a version.

Parameters

string $name package name
string|ConstraintInterface $constraint package version or version constraint to match against

Return Value

PackageInterface[]

Searches the repository for packages containing the query

Parameters

string $query search query
int $mode a set of SEARCH_* constants to search on, implementations should do a best effort only
$type

Return Value

array[] an array of array('name' => '...', 'description' => '...')

bool hasPackage(PackageInterface $package)

Checks if specified package registered (installed).

Parameters

PackageInterface $package package instance

Return Value

bool

addPackage(PackageInterface $package)

Adds a new package to the repository

Parameters

PackageInterface $package

protected createAliasPackage(PackageInterface $package, $alias, $prettyAlias)

Parameters

PackageInterface $package
$alias
$prettyAlias

removePackage(PackageInterface $package)

Removes package from repository.

Parameters

PackageInterface $package package instance

PackageInterface[] getPackages()

Returns list of registered packages.

Return Value

PackageInterface[]

int count()

Returns the number of packages in this repository

Return Value

int Number of packages

protected initialize()

Initializes the packages array. Mostly meant as an extension point.

getRepoConfig()

setRootAliases(array $rootAliases)

Parameters

array $rootAliases

getProviderNames()

protected configurePackageTransportOptions(PackageInterface $package)

Parameters

PackageInterface $package

hasProviders()

resetPackageIds()

array|mixed whatProvides(Pool $pool, string $name, bool $bypassFilters = false)

Parameters

Pool $pool
string $name package name
bool $bypassFilters If set to true, this bypasses the stability filtering, and forces a recompute without cache

Return Value

array|mixed

protected loadRootServerFile()

protected canonicalizeUrl($url)

Parameters

$url

protected loadDataFromServer()

protected loadProviderListings($data)

Parameters

$data

protected loadIncludes($data)

Parameters

$data

protected createPackage(array $data, $class = 'Composer\\Package\\CompletePackage')

Parameters

array $data
$class

protected fetchFile($filename, $cacheKey = null, $sha256 = null, $storeLastModifiedTime = false)

Parameters

$filename
$cacheKey
$sha256
$storeLastModifiedTime

protected fetchFileIfLastModified($filename, $cacheKey, $lastModifiedTime)

Parameters

$filename
$cacheKey
$lastModifiedTime