ComposerRepository
extends ArrayRepository
in package
implements
ConfigurableRepositoryInterface
A repository implementation that simply stores packages in an array
Tags
Interfaces, Classes and Traits
- ConfigurableRepositoryInterface
- Configurable repository interface.
Table of Contents
- $allowSslDowngrade : mixed
- $baseUrl : mixed
- $cache : mixed
- $config : mixed
- $distMirrors : mixed
- $eventDispatcher : mixed
- $hasProviders : mixed
- $io : mixed
- $lazyProvidersUrl : mixed
- $loader : mixed
- $notifyUrl : mixed
- $options : mixed
- $packageMap : array<string|int, PackageInterface>
- $packages : array<string|int, PackageInterface>
- $providerListing : mixed
- $providers : mixed
- $providersByUid : mixed
- $providersUrl : mixed
- $repoConfig : mixed
- $rfs : mixed
- $rootAliases : mixed
- $searchUrl : mixed
- $sourceMirrors : mixed
- $url : mixed
- $degradedMode : mixed
- $hasPartialPackages : mixed
- $partialPackagesByName : mixed
- $rootData : mixed
- __construct() : mixed
- 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}
- 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}
- getProviderNames() : mixed
- getRepoConfig() : mixed
- hasPackage() : mixed
- {@inheritDoc}
- hasProviders() : mixed
- removePackage() : mixed
- Removes package from repository.
- resetPackageIds() : mixed
- search() : mixed
- {@inheritDoc}
- setRootAliases() : mixed
- whatProvides() : array<string|int, mixed>|mixed
- canonicalizeUrl() : mixed
- configurePackageTransportOptions() : mixed
- createAliasPackage() : mixed
- createPackage() : mixed
- fetchFile() : mixed
- fetchFileIfLastModified() : mixed
- initialize() : mixed
- Initializes the packages array. Mostly meant as an extension point.
- loadDataFromServer() : mixed
- loadIncludes() : mixed
- loadProviderListings() : mixed
- loadRootServerFile() : mixed
- initializePartialPackages() : mixed
- This initializes the packages key of a partial packages.json that contain some packages inlined + a providers-lazy-url
Properties
$allowSslDowngrade
protected
mixed
$allowSslDowngrade
= false
$baseUrl
protected
mixed
$baseUrl
$cache
protected
mixed
$cache
$config
protected
mixed
$config
$distMirrors
protected
mixed
$distMirrors
$eventDispatcher
protected
mixed
$eventDispatcher
$hasProviders
protected
mixed
$hasProviders
= false
$io
protected
mixed
$io
$lazyProvidersUrl
protected
mixed
$lazyProvidersUrl
$loader
protected
mixed
$loader
$notifyUrl
protected
mixed
$notifyUrl
$options
protected
mixed
$options
$packageMap
protected
array<string|int, PackageInterface>
$packageMap
indexed by package unique name and used to cache hasPackage calls
$packages
protected
array<string|int, PackageInterface>
$packages
$providerListing
protected
mixed
$providerListing
$providers
protected
mixed
$providers
= array()
$providersByUid
protected
mixed
$providersByUid
= array()
$providersUrl
protected
mixed
$providersUrl
$repoConfig
protected
mixed
$repoConfig
$rfs
protected
mixed
$rfs
$rootAliases
protected
mixed
$rootAliases
$searchUrl
protected
mixed
$searchUrl
$sourceMirrors
protected
mixed
$sourceMirrors
$url
protected
mixed
$url
$degradedMode
private
mixed
$degradedMode
= false
$hasPartialPackages
private
mixed
$hasPartialPackages
$partialPackagesByName
private
mixed
$partialPackagesByName
$rootData
private
mixed
$rootData
Methods
__construct()
public
__construct(array<string|int, mixed> $repoConfig, IOInterface $io, Config $config[, EventDispatcher $eventDispatcher = null ][, RemoteFilesystem $rfs = null ]) : mixed
Parameters
- $repoConfig : array<string|int, mixed>
- $io : IOInterface
- $config : Config
- $eventDispatcher : EventDispatcher = null
- $rfs : RemoteFilesystem = null
Return values
mixed —addPackage()
Adds a new package to the repository
public
addPackage(PackageInterface $package) : mixed
Parameters
- $package : PackageInterface
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 —getProviderNames()
public
getProviderNames() : mixed
Return values
mixed —getRepoConfig()
public
getRepoConfig() : mixed
Return values
mixed —hasPackage()
{@inheritDoc}
public
hasPackage(PackageInterface $package) : mixed
Parameters
- $package : PackageInterface
Return values
mixed —hasProviders()
public
hasProviders() : mixed
Return values
mixed —removePackage()
Removes package from repository.
public
removePackage(PackageInterface $package) : mixed
Parameters
- $package : PackageInterface
-
package instance
Return values
mixed —resetPackageIds()
public
resetPackageIds() : mixed
Return values
mixed —search()
{@inheritDoc}
public
search(mixed $query, mixed $mode[, mixed $type = null ]) : mixed
Parameters
- $query : mixed
- $mode : mixed
- $type : mixed = null
Return values
mixed —setRootAliases()
public
setRootAliases(array<string|int, mixed> $rootAliases) : mixed
Parameters
- $rootAliases : array<string|int, mixed>
Return values
mixed —whatProvides()
public
whatProvides(Pool $pool, string $name[, bool $bypassFilters = false ]) : array<string|int, mixed>|mixed
Parameters
- $pool : Pool
- $name : string
-
package name
- $bypassFilters : bool = false
-
If set to true, this bypasses the stability filtering, and forces a recompute without cache
Return values
array<string|int, mixed>|mixed —canonicalizeUrl()
protected
canonicalizeUrl(mixed $url) : mixed
Parameters
- $url : mixed
Return values
mixed —configurePackageTransportOptions()
protected
configurePackageTransportOptions(PackageInterface $package) : mixed
Parameters
- $package : PackageInterface
Return values
mixed —createAliasPackage()
protected
createAliasPackage(PackageInterface $package, mixed $alias, mixed $prettyAlias) : mixed
Parameters
- $package : PackageInterface
- $alias : mixed
- $prettyAlias : mixed
Return values
mixed —createPackage()
protected
createPackage(array<string|int, mixed> $data[, mixed $class = 'Composer\Package\CompletePackage' ]) : mixed
Parameters
- $data : array<string|int, mixed>
- $class : mixed = 'Composer\Package\CompletePackage'
Return values
mixed —fetchFile()
protected
fetchFile(mixed $filename[, mixed $cacheKey = null ][, mixed $sha256 = null ][, mixed $storeLastModifiedTime = false ]) : mixed
Parameters
- $filename : mixed
- $cacheKey : mixed = null
- $sha256 : mixed = null
- $storeLastModifiedTime : mixed = false
Return values
mixed —fetchFileIfLastModified()
protected
fetchFileIfLastModified(mixed $filename, mixed $cacheKey, mixed $lastModifiedTime) : mixed
Parameters
- $filename : mixed
- $cacheKey : mixed
- $lastModifiedTime : mixed
Return values
mixed —initialize()
Initializes the packages array. Mostly meant as an extension point.
protected
initialize() : mixed
Return values
mixed —loadDataFromServer()
protected
loadDataFromServer() : mixed
Return values
mixed —loadIncludes()
protected
loadIncludes(mixed $data) : mixed
Parameters
- $data : mixed
Return values
mixed —loadProviderListings()
protected
loadProviderListings(mixed $data) : mixed
Parameters
- $data : mixed
Return values
mixed —loadRootServerFile()
protected
loadRootServerFile() : mixed
Return values
mixed —initializePartialPackages()
This initializes the packages key of a partial packages.json that contain some packages inlined + a providers-lazy-url
private
initializePartialPackages() : mixed
This should only be called once