RepositoryManager
in package
Repositories manager.
Tags
Table of Contents
- $config : mixed
- $eventDispatcher : mixed
- $io : mixed
- $localRepository : mixed
- $repositories : mixed
- $repositoryClasses : mixed
- $rfs : mixed
- __construct() : mixed
- addRepository() : mixed
- Adds repository
- createRepository() : RepositoryInterface
- Returns a new repository for a specific installation type.
- findPackage() : PackageInterface|null
- Searches for a package by it's name and version in managed repositories.
- findPackages() : array<string|int, PackageInterface>
- Searches for all packages matching a name and optionally a version in managed repositories.
- getLocalRepository() : WritableRepositoryInterface
- Returns local repository for the project.
- getRepositories() : array<string|int, RepositoryInterface>
- Returns all repositories, except local one.
- prependRepository() : mixed
- Adds a repository to the beginning of the chain
- setLocalRepository() : mixed
- Sets local repository for the project.
- setRepositoryClass() : mixed
- Stores repository class for a specific installation type.
Properties
$config
private
mixed
$config
$eventDispatcher
private
mixed
$eventDispatcher
$io
private
mixed
$io
$localRepository
private
mixed
$localRepository
$repositories
private
mixed
$repositories
= array()
$repositoryClasses
private
mixed
$repositoryClasses
= array()
$rfs
private
mixed
$rfs
Methods
__construct()
public
__construct(IOInterface $io, Config $config[, EventDispatcher $eventDispatcher = null ][, RemoteFilesystem $rfs = null ]) : mixed
Parameters
- $io : IOInterface
- $config : Config
- $eventDispatcher : EventDispatcher = null
- $rfs : RemoteFilesystem = null
Return values
mixed —addRepository()
Adds repository
public
addRepository(RepositoryInterface $repository) : mixed
Parameters
- $repository : RepositoryInterface
-
repository instance
Return values
mixed —createRepository()
Returns a new repository for a specific installation type.
public
createRepository(string $type, array<string|int, mixed> $config[, string $name = null ]) : RepositoryInterface
Parameters
- $type : string
-
repository type
- $config : array<string|int, mixed>
-
repository configuration
- $name : string = null
-
repository name
Tags
Return values
RepositoryInterface —findPackage()
Searches for a package by it's name and version in managed repositories.
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 in managed repositories.
public
findPackages(string $name, string|ConstraintInterface $constraint) : array<string|int, PackageInterface>
Parameters
- $name : string
-
package name
- $constraint : string|ConstraintInterface
-
package version or version constraint to match against
Return values
array<string|int, PackageInterface> —getLocalRepository()
Returns local repository for the project.
public
getLocalRepository() : WritableRepositoryInterface
Return values
WritableRepositoryInterface —getRepositories()
Returns all repositories, except local one.
public
getRepositories() : array<string|int, RepositoryInterface>
Return values
array<string|int, RepositoryInterface> —prependRepository()
Adds a repository to the beginning of the chain
public
prependRepository(RepositoryInterface $repository) : mixed
This is useful when injecting additional repositories that should trump Packagist, e.g. from a plugin.
Parameters
- $repository : RepositoryInterface
-
repository instance
Return values
mixed —setLocalRepository()
Sets local repository for the project.
public
setLocalRepository(WritableRepositoryInterface $repository) : mixed
Parameters
- $repository : WritableRepositoryInterface
-
repository instance
Return values
mixed —setRepositoryClass()
Stores repository class for a specific installation type.
public
setRepositoryClass(string $type, string $class) : mixed
Parameters
- $type : string
-
installation type
- $class : string
-
class name of the repo implementation