Documentation

FilesystemRepository extends WritableArrayRepository
in package

Filesystem repository.

Tags
author

Konstantin Kudryashov ever.zet@gmail.com

author

Jordi Boggiano j.boggiano@seld.be

Table of Contents

$packageMap  : array<string|int, PackageInterface>
$packages  : array<string|int, PackageInterface>
$file  : mixed
__construct()  : mixed
Initializes filesystem repository.
addPackage()  : mixed
Adds a new package to the repository
count()  : int
Returns the number of packages in this repository
findPackage()  : mixed
{@inheritDoc}
findPackages()  : mixed
{@inheritDoc}
getCanonicalPackages()  : array<string|int, PackageInterface>
Get unique packages (at most one package of each name), with aliases resolved and removed.
getDependents()  : array<string|int, mixed>
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.
getPackages()  : mixed
{@inheritDoc}
hasPackage()  : mixed
{@inheritDoc}
reload()  : mixed
Forces a reload of all packages.
removePackage()  : mixed
Removes package from repository.
search()  : mixed
{@inheritDoc}
write()  : mixed
Writes writable repository.
createAliasPackage()  : mixed
initialize()  : mixed
Initializes repository (reads file, or remote address).

Properties

Methods

__construct()

Initializes filesystem repository.

public __construct(JsonFile $repositoryFile) : mixed
Parameters
$repositoryFile : JsonFile

repository json file

Return values
mixed

count()

Returns the number of packages in this repository

public count() : int
Return values
int

Number of packages

findPackage()

{@inheritDoc}

public findPackage(mixed $name, mixed $constraint) : mixed
Parameters
$name : mixed
$constraint : mixed
Return values
mixed

findPackages()

{@inheritDoc}

public findPackages(mixed $name[, mixed $constraint = null ]) : mixed
Parameters
$name : mixed
$constraint : mixed = null
Return values
mixed

getDependents()

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.

public getDependents(string|array<string|int, string> $needle[, ConstraintInterface|null $constraint = null ][, bool $invert = false ][, bool $recurse = true ][, array<string|int, string> $packagesFound = null ]) : array<string|int, mixed>
Parameters
$needle : string|array<string|int, string>

The package name(s) to inspect.

$constraint : ConstraintInterface|null = null

Optional constraint to filter by.

$invert : bool = false

Whether to invert matches to discover reasons for the package NOT to be installed.

$recurse : bool = true

Whether to recursively expand the requirement tree up to the root package.

$packagesFound : array<string|int, string> = null

Used internally when recurring

Return values
array<string|int, mixed>

An associative array of arrays as described above.

getPackages()

{@inheritDoc}

public getPackages() : mixed
Return values
mixed

reload()

Forces a reload of all packages.

public reload() : mixed
Return values
mixed

{@inheritDoc}

public search(mixed $query, mixed $mode[, mixed $type = null ]) : mixed
Parameters
$query : mixed
$mode : mixed
$type : mixed = null
Return values
mixed

initialize()

Initializes repository (reads file, or remote address).

protected initialize() : mixed
Return values
mixed

Search results