BasePackage
in package
implements
PackageInterface
Base class for packages providing name storage and default match implementation
Tags
Interfaces, Classes and Traits
- PackageInterface
- Defines the essential information a package has that is used during solving/installation
Table of Contents
- STABILITY_ALPHA = 15
- STABILITY_BETA = 10
- STABILITY_DEV = 20
- STABILITY_RC = 5
- STABILITY_STABLE = 0
- $id : int
- READ-ONLY: The package id, public for fast access in dependency solver
- $stabilities : mixed
- $supportedLinkTypes : mixed
- $name : string
- $prettyName : string
- $repository : RepositoryInterface
- $transportOptions : array<string|int, mixed>
- __clone() : mixed
- __construct() : mixed
- All descendants' constructors should call this parent constructor
- __toString() : string
- Converts the package into a readable and unique string
- equals() : mixed
- getFullPrettyVersion() : string
- Returns the pretty version string plus a git or hg commit hash of this package
- getId() : int
- Retrieves the package's id set through setId
- getName() : string
- Returns the package's name without version info, thus not a unique identifier
- getNames() : array<string|int, mixed>
- Returns a set of names that could refer to this package
- getPrettyName() : string
- Returns the package's pretty (i.e. with proper case) name
- getPrettyString() : string
- Converts the package into a pretty readable string
- getRepository() : RepositoryInterface
- Returns a reference to the repository that owns the package
- getStabilityPriority() : mixed
- getTransportOptions() : array<string|int, mixed>
- Returns a list of options to download package dist files
- getUniqueName() : string
- Returns package unique name, constructed from name, version and release type.
- isPlatform() : bool
- checks if this package is a platform package
- packageNameToRegexp() : string
- Build a regexp from a package name, expanding * globs as required
- setId() : mixed
- Allows the solver to set an id for this package to refer to it.
- setRepository() : mixed
- Stores a reference to the repository that owns the package
- setTransportOptions() : mixed
- Configures the list of options to download package dist files
Constants
STABILITY_ALPHA
public
mixed
STABILITY_ALPHA
= 15
STABILITY_BETA
public
mixed
STABILITY_BETA
= 10
STABILITY_DEV
public
mixed
STABILITY_DEV
= 20
STABILITY_RC
public
mixed
STABILITY_RC
= 5
STABILITY_STABLE
public
mixed
STABILITY_STABLE
= 0
Properties
$id
READ-ONLY: The package id, public for fast access in dependency solver
public
int
$id
$stabilities
public
static mixed
$stabilities
= array('stable' => self::STABILITY_STABLE, 'RC' => self::STABILITY_RC, 'beta' => self::STABILITY_BETA, 'alpha' => self::STABILITY_ALPHA, 'dev' => self::STABILITY_DEV)
$supportedLinkTypes
public
static mixed
$supportedLinkTypes
= array('require' => array('description' => 'requires', 'method' => 'requires'), 'conflict' => array('description' => 'conflicts', 'method' => 'conflicts'), 'provide' => array('description' => 'provides', 'method' => 'provides'), 'replace' => array('description' => 'replaces', 'method' => 'replaces'), 'require-dev' => array('description' => 'requires (for development)', 'method' => 'devRequires'))
$name
protected
string
$name
$prettyName
protected
string
$prettyName
$repository
protected
RepositoryInterface
$repository
$transportOptions
protected
array<string|int, mixed>
$transportOptions
= array()
Methods
__clone()
public
__clone() : mixed
Return values
mixed —__construct()
All descendants' constructors should call this parent constructor
public
__construct(string $name) : mixed
Parameters
- $name : string
-
The package's name
Return values
mixed —__toString()
Converts the package into a readable and unique string
public
__toString() : string
Return values
string —equals()
public
equals(PackageInterface $package) : mixed
Parameters
- $package : PackageInterface
Return values
mixed —getFullPrettyVersion()
Returns the pretty version string plus a git or hg commit hash of this package
public
getFullPrettyVersion([mixed $truncate = true ]) : string
Parameters
- $truncate : mixed = true
-
If the source reference is a sha1 hash, truncate it
Return values
string —version
getId()
Retrieves the package's id set through setId
public
getId() : int
Return values
int —The previously set package id
getName()
Returns the package's name without version info, thus not a unique identifier
public
getName() : string
Return values
string —package name
getNames()
Returns a set of names that could refer to this package
public
getNames() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of strings referring to this package
getPrettyName()
Returns the package's pretty (i.e. with proper case) name
public
getPrettyName() : string
Return values
string —package name
getPrettyString()
Converts the package into a pretty readable string
public
getPrettyString() : string
Return values
string —getRepository()
Returns a reference to the repository that owns the package
public
getRepository() : RepositoryInterface
Return values
RepositoryInterface —getStabilityPriority()
public
getStabilityPriority() : mixed
Return values
mixed —getTransportOptions()
Returns a list of options to download package dist files
public
getTransportOptions() : array<string|int, mixed>
Return values
array<string|int, mixed> —getUniqueName()
Returns package unique name, constructed from name, version and release type.
public
getUniqueName() : string
Return values
string —isPlatform()
checks if this package is a platform package
public
isPlatform() : bool
Return values
bool —packageNameToRegexp()
Build a regexp from a package name, expanding * globs as required
public
static packageNameToRegexp(string $allowListPattern[, string $wrap = '{^%s$}i' ]) : string
Parameters
- $allowListPattern : string
- $wrap : string = '{^%s$}i'
-
Wrap the cleaned string by the given string
Return values
string —setId()
Allows the solver to set an id for this package to refer to it.
public
setId(mixed $id) : mixed
Parameters
- $id : mixed
Return values
mixed —setRepository()
Stores a reference to the repository that owns the package
public
setRepository(RepositoryInterface $repository) : mixed
Parameters
- $repository : RepositoryInterface
Return values
mixed —setTransportOptions()
Configures the list of options to download package dist files
public
setTransportOptions(array<string|int, mixed> $options) : mixed
Parameters
- $options : array<string|int, mixed>