Composer API
Interface

Composer\Repository\InstalledRepositoryInterface

interface InstalledRepositoryInterface implements WritableRepositoryInterface

Installable repository interface.

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

Methods

bool hasPackage(PackageInterface $package)

Checks if specified package registered (installed).

from RepositoryInterface
PackageInterface|null findPackage(string $name, string $version)

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

from RepositoryInterface
array findPackages(string $name, string $version = null)

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

from RepositoryInterface
array getPackages()

Returns list of registered packages.

from RepositoryInterface
write()

Writes repository (f.e.

from WritableRepositoryInterface
addPackage(PackageInterface $package)

Adds package to the repository.

from WritableRepositoryInterface
removePackage(PackageInterface $package)

Removes package from the repository.

from WritableRepositoryInterface
reload()

Forces a reload of all packages

from WritableRepositoryInterface

Details

in RepositoryInterface at line 32
public bool hasPackage(PackageInterface $package)

Checks if specified package registered (installed).

Parameters

PackageInterface $package package instance

Return Value

bool

in RepositoryInterface at line 42
public PackageInterface|null findPackage(string $name, string $version)

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

Parameters

string $name package name
string $version package version

Return Value

PackageInterface|null

in RepositoryInterface at line 52
public array findPackages(string $name, string $version = null)

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

Parameters

string $name package name
string $version package version

Return Value

array

in RepositoryInterface at line 59
public array getPackages()

Returns list of registered packages.

Return Value

array

public write()

Writes repository (f.e.

to the disc).

public addPackage(PackageInterface $package)

Adds package to the repository.

Parameters

PackageInterface $package package instance

public removePackage(PackageInterface $package)

Removes package from the repository.

Parameters

PackageInterface $package package instance

public reload()

Forces a reload of all packages