\Composer\RepositoryInstalledRepositoryInterface

Installable repository interface.

Just used to tag installed repositories so the base classes can act differently on Alias packages

Summary

Methods
Constants
write()
addPackage()
removePackage()
getCanonicalPackages()
reload()
hasPackage()
findPackage()
findPackages()
getPackages()
search()
SEARCH_FULLTEXT
SEARCH_NAME
No protected methods found
N/A
No private methods found
N/A

Methods

write()

write() 

Writes repository (f.e. to the disc).

addPackage()

addPackage(\Composer\Package\PackageInterface  $package) 

Adds package to the repository.

Parameters

\Composer\Package\PackageInterface $package

package instance

removePackage()

removePackage(\Composer\Package\PackageInterface  $package) 

Removes package from the repository.

Parameters

\Composer\Package\PackageInterface $package

package instance

getCanonicalPackages()

getCanonicalPackages() : array<mixed,\Composer\Package\PackageInterface>

Get unique packages (at most one package of each name), with aliases resolved and removed.

Returns

array<mixed,\Composer\Package\PackageInterface>

reload()

reload() 

Forces a reload of all packages.

hasPackage()

hasPackage(\Composer\Package\PackageInterface  $package) : boolean

Checks if specified package registered (installed).

Parameters

\Composer\Package\PackageInterface $package

package instance

Returns

boolean

findPackage()

findPackage(string  $name, string|\Composer\Semver\Constraint\ConstraintInterface  $constraint) : \Composer\Package\PackageInterface|null

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

Parameters

string $name

package name

string|\Composer\Semver\Constraint\ConstraintInterface $constraint

package version or version constraint to match against

Returns

\Composer\Package\PackageInterface|null

findPackages()

findPackages(string  $name, string|\Composer\Semver\Constraint\ConstraintInterface  $constraint = null) : array<mixed,\Composer\Package\PackageInterface>

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

Parameters

string $name

package name

string|\Composer\Semver\Constraint\ConstraintInterface $constraint

package version or version constraint to match against

Returns

array<mixed,\Composer\Package\PackageInterface>

getPackages()

getPackages() : array<mixed,\Composer\Package\PackageInterface>

Returns list of registered packages.

Returns

array<mixed,\Composer\Package\PackageInterface>

search()

search(string  $query, integer  $mode) : array<mixed,array>

Searches the repository for packages containing the query

Parameters

string $query

search query

integer $mode

a set of SEARCH_* constants to search on, implementations should do a best effort only

Returns

array<mixed,array> —

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