Composer API
Class

Composer\Repository\PearRepository

class PearRepository extends ArrayRepository implements ConfigurableRepositoryInterface

Builds list of package from PEAR channel.

Packages read from channel are named as 'pear-{channelName}/{packageName}' and has aliased as 'pear-{channelAlias}/{packageName}'

Methods

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

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.

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

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

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

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

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

from ArrayRepository
array[] search(string $query, int $mode)

Searches the repository for packages containing the query

from ArrayRepository
bool hasPackage(PackageInterface $package)

Checks if specified package registered (installed).

from ArrayRepository
addPackage(PackageInterface $package)

Adds a new package to the repository

from ArrayRepository
removePackage(PackageInterface $package)

Removes package from repository.

from ArrayRepository
PackageInterface[] getPackages()

Returns list of registered packages.

from ArrayRepository
int count()

Returns the number of packages in this repository

from ArrayRepository
getRepoConfig()

Details

in BaseRepository at line 37
public array getDependents(string|string[] $needle, ConstraintInterface|null $constraint = null, bool $invert = false, bool $recurse = true)

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.

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.

Return Value

array An associative array of arrays as described above.

at line 50
public __construct(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $dispatcher = null, RemoteFilesystem $rfs = null)

Parameters

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

in ArrayRepository at line 42
public 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

in ArrayRepository at line 64
public 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

Return Value

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

in ArrayRepository at line 116
public bool hasPackage(PackageInterface $package)

Checks if specified package registered (installed).

Parameters

PackageInterface $package package instance

Return Value

bool

in ArrayRepository at line 134
public addPackage(PackageInterface $package)

Adds a new package to the repository

Parameters

PackageInterface $package

in ArrayRepository at line 160
public removePackage(PackageInterface $package)

Removes package from repository.

Parameters

PackageInterface $package package instance

in ArrayRepository at line 176
public PackageInterface[] getPackages()

Returns list of registered packages.

Return Value

PackageInterface[]

in ArrayRepository at line 190
public int count()

Returns the number of packages in this repository

Return Value

int Number of packages

at line 70
public getRepoConfig()