Composer API
Class

Composer\Repository\InstalledFilesystemRepository

class InstalledFilesystemRepository extends FilesystemRepository implements InstalledRepositoryInterface

Installed filesystem repository.

Methods

__construct(JsonFile $repositoryFile)

Initializes filesystem repository.

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

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

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

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

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
array getPackages()

Returns list of registered packages.

from ArrayRepository
int count()

Returns the number of packages in this repository

from ArrayRepository
reload()

Forces a reload of all packages

from FilesystemRepository
write()

Writes writable repository.

from FilesystemRepository

Details

in FilesystemRepository at line 35
public __construct(JsonFile $repositoryFile)

Initializes filesystem repository.

Parameters

JsonFile $repositoryFile repository json file

in ArrayRepository at line 38
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 ArrayRepository at line 55
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 ArrayRepository at line 80
public bool hasPackage(PackageInterface $package)

Checks if specified package registered (installed).

Parameters

PackageInterface $package package instance

Return Value

bool

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

Adds a new package to the repository

Parameters

PackageInterface $package

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

Removes package from repository.

Parameters

PackageInterface $package package instance

in ArrayRepository at line 141
public array getPackages()

Returns list of registered packages.

Return Value

array

in ArrayRepository at line 155
public int count()

Returns the number of packages in this repository

Return Value

int Number of packages

in FilesystemRepository at line 64
public reload()

Forces a reload of all packages

in FilesystemRepository at line 73
public write()

Writes writable repository.