WritableRepositoryInterface
extends
RepositoryInterface
in
Writable repository interface.
Tags
Table of Contents
- SEARCH_FULLTEXT = 0
- SEARCH_NAME = 1
- addPackage() : mixed
- Adds package to the repository.
- findPackage() : PackageInterface|null
- Searches for the first match of a package by name and version.
- findPackages() : array<string|int, PackageInterface>
- Searches for all packages matching a name and optionally a version.
- getCanonicalPackages() : array<string|int, PackageInterface>
- Get unique packages (at most one package of each name), with aliases resolved and removed.
- getPackages() : array<string|int, PackageInterface>
- Returns list of registered packages.
- hasPackage() : bool
- Checks if specified package registered (installed).
- reload() : mixed
- Forces a reload of all packages.
- removePackage() : mixed
- Removes package from the repository.
- search() : array<string|int, array<string|int, mixed>>
- Searches the repository for packages containing the query
- write() : mixed
- Writes repository (f.e. to the disc).
Constants
SEARCH_FULLTEXT
public
mixed
SEARCH_FULLTEXT
= 0
SEARCH_NAME
public
mixed
SEARCH_NAME
= 1
Methods
addPackage()
Adds package to the repository.
public
addPackage(PackageInterface $package) : mixed
Parameters
- $package : PackageInterface
-
package instance
Return values
mixed —findPackage()
Searches for the first match of a package by name and version.
public
findPackage(string $name, string|ConstraintInterface $constraint) : PackageInterface|null
Parameters
- $name : string
-
package name
- $constraint : string|ConstraintInterface
-
package version or version constraint to match against
Return values
PackageInterface|null —findPackages()
Searches for all packages matching a name and optionally a version.
public
findPackages(string $name[, string|ConstraintInterface $constraint = null ]) : array<string|int, PackageInterface>
Parameters
- $name : string
-
package name
- $constraint : string|ConstraintInterface = null
-
package version or version constraint to match against
Return values
array<string|int, PackageInterface> —getCanonicalPackages()
Get unique packages (at most one package of each name), with aliases resolved and removed.
public
getCanonicalPackages() : array<string|int, PackageInterface>
Return values
array<string|int, PackageInterface> —getPackages()
Returns list of registered packages.
public
getPackages() : array<string|int, PackageInterface>
Return values
array<string|int, PackageInterface> —hasPackage()
Checks if specified package registered (installed).
public
hasPackage(PackageInterface $package) : bool
Parameters
- $package : PackageInterface
-
package instance
Return values
bool —reload()
Forces a reload of all packages.
public
reload() : mixed
Return values
mixed —removePackage()
Removes package from the repository.
public
removePackage(PackageInterface $package) : mixed
Parameters
- $package : PackageInterface
-
package instance
Return values
mixed —search()
Searches the repository for packages containing the query
public
search(string $query, int $mode) : array<string|int, array<string|int, mixed>>
Parameters
- $query : string
-
search query
- $mode : int
-
a set of SEARCH_* constants to search on, implementations should do a best effort only
Return values
array<string|int, array<string|int, mixed>> —an array of array('name' => '...', 'description' => '...')
write()
Writes repository (f.e. to the disc).
public
write() : mixed