Composer API
Class

Composer\Package\AliasPackage

class AliasPackage extends BasePackage implements CompletePackageInterface

Constants

STABILITY_STABLE

STABILITY_RC

STABILITY_BETA

STABILITY_ALPHA

STABILITY_DEV

Properties

static $supportedLinkTypes
static $stabilities
int $id READ-ONLY: The package id, public for fast access in dependency solver

Methods

__construct(PackageInterface $aliasOf, string $version, string $prettyVersion)

All descendants' constructors should call this parent constructor

string getName()

Returns the package's name without version info, thus not a unique identifier

from BasePackage
string getPrettyName()

Returns the package's pretty (i.e.

from BasePackage
array getNames()

Returns a set of names that could refer to this package

from BasePackage
setId(int $id)

Allows the solver to set an id for this package to refer to it.

from BasePackage
int getId()

Retrieves the package's id set through setId

from BasePackage
setRepository(RepositoryInterface $repository)

Stores a reference to the repository that owns the package

from BasePackage
RepositoryInterface getRepository()

Returns a reference to the repository that owns the package

from BasePackage
array getTransportOptions()

Returns a list of options to download package dist files

setTransportOptions(array $options)

Configures the list of options to download package dist files

bool isPlatform()

checks if this package is a platform package

from BasePackage
string getUniqueName()

Returns package unique name, constructed from name and version.

from BasePackage
equals(PackageInterface $package)

from BasePackage
string __toString()

Converts the package into a readable and unique string

string getPrettyString()

Converts the package into a pretty readable string

from BasePackage
string getFullPrettyVersion(bool $truncate = true)

Returns the pretty version string plus a git or hg commit hash of this package

from BasePackage
getStabilityPriority()

from BasePackage
__clone()

from BasePackage
PackageInterface getAliasOf()

string getVersion()

Returns the version of this package

string getStability()

Returns the stability of this package: one of (dev, alpha, beta, RC, stable)

string getPrettyVersion()

Returns the pretty (i.e.

bool isDev()

Returns whether the package is a development virtual package or a concrete one

Link[] getRequires()

Returns a set of links to packages which need to be installed before this package can be installed

Link[] getConflicts()

Returns a set of links to packages which must not be installed at the same time as this package

Link[] getProvides()

Returns a set of links to virtual packages that are provided through this package

Link[] getReplaces()

Returns a set of links to packages which can alternatively be satisfied by installing this package

Link[] getDevRequires()

Returns a set of links to packages which are required to develop this package.

mixed setRootPackageAlias(bool $value)

Stores whether this is an alias created by an aliasing in the requirements of the root package or not

bool isRootPackageAlias()

string getType()

Returns the package type, e.g.

string getTargetDir()

Returns the package targetDir property

array getExtra()

Returns the package extra data

setInstallationSource(string $type)

Sets source from which this package was installed (source/dist).

string getInstallationSource()

Returns source from which this package was installed (source/dist).

string getSourceType()

Returns the repository type of this package, e.g.

string getSourceUrl()

Returns the repository url of this package, e.g.

array getSourceUrls()

Returns the repository urls of this package including mirrors, e.g.

string getSourceReference()

Returns the repository reference of this package, e.g.

setSourceReference($reference)

setSourceMirrors($mirrors)

array|null getSourceMirrors()

Returns the source mirrors of this package

string getDistType()

Returns the type of the distribution archive of this version, e.g.

string getDistUrl()

Returns the url of the distribution archive of this version

array getDistUrls()

Returns the urls of the distribution archive of this version, including mirrors

string getDistReference()

Returns the reference of the distribution archive of this version, e.g.

setDistReference($reference)

string getDistSha1Checksum()

Returns the sha1 checksum for the distribution archive of this version

setDistMirrors($mirrors)

array|null getDistMirrors()

Returns the dist mirrors of this package

array getScripts()

Returns the scripts of this package

array getLicense()

Returns the package license, e.g.

array getAutoload()

Returns an associative array of autoloading rules

array getDevAutoload()

Returns an associative array of dev autoloading rules

array getIncludePaths()

Returns a list of directories which should get added to PHP's include path.

array getRepositories()

Returns an array of repositories

DateTime getReleaseDate()

Returns the release date of the package

array getBinaries()

Returns the package binaries

array getKeywords()

Returns an array of keywords relating to the package

string getDescription()

Returns the package description

string getHomepage()

Returns the package homepage

array getSuggests()

Returns a set of package names and reasons why they are useful in combination with this package.

array getAuthors()

Returns an array of authors of the package

array getSupport()

Returns the support information

string getNotificationUrl()

Returns the package notification url

array getArchiveExcludes()

Returns a list of patterns to exclude from package archives

bool isAbandoned()

Returns if the package is abandoned or not

string getReplacementPackage()

If the package is abandoned and has a suggested replacement, this method returns it

Details

at line 49
public __construct(PackageInterface $aliasOf, string $version, string $prettyVersion)

All descendants' constructors should call this parent constructor

Parameters

PackageInterface $aliasOf The package this package is an alias of
string $version The version the alias must report
string $prettyVersion The alias's non-normalized version

in BasePackage at line 75
public string getName()

Returns the package's name without version info, thus not a unique identifier

Return Value

string package name

in BasePackage at line 83
public string getPrettyName()

Returns the package's pretty (i.e.

with proper case) name

Return Value

string package name

in BasePackage at line 91
public array getNames()

Returns a set of names that could refer to this package

No version or release type information should be included in any of the names. Provided or replaced package names need to be returned as well.

Return Value

array An array of strings referring to this package

in BasePackage at line 111
public setId(int $id)

Allows the solver to set an id for this package to refer to it.

Parameters

int $id

in BasePackage at line 119
public int getId()

Retrieves the package's id set through setId

Return Value

int The previously set package id

in BasePackage at line 127
public setRepository(RepositoryInterface $repository)

Stores a reference to the repository that owns the package

Parameters

RepositoryInterface $repository

in BasePackage at line 138
public RepositoryInterface getRepository()

Returns a reference to the repository that owns the package

Return Value

RepositoryInterface

at line 295
public array getTransportOptions()

Returns a list of options to download package dist files

Return Value

array

at line 290
public setTransportOptions(array $options)

Configures the list of options to download package dist files

Parameters

array $options

in BasePackage at line 166
public bool isPlatform()

checks if this package is a platform package

Return Value

bool

in BasePackage at line 176
public string getUniqueName()

Returns package unique name, constructed from name and version.

Return Value

string

in BasePackage at line 181
public equals(PackageInterface $package)

Parameters

PackageInterface $package

at line 400
public string __toString()

Converts the package into a readable and unique string

Return Value

string

in BasePackage at line 204
public string getPrettyString()

Converts the package into a pretty readable string

Return Value

string

in BasePackage at line 212
public string getFullPrettyVersion(bool $truncate = true)

Returns the pretty version string plus a git or hg commit hash of this package

Parameters

bool $truncate If the source reference is a sha1 hash, truncate it

Return Value

string version

in BasePackage at line 226
public getStabilityPriority()

in BasePackage at line 231
public __clone()

at line 68
public PackageInterface getAliasOf()

Return Value

PackageInterface

at line 76
public string getVersion()

Returns the version of this package

Return Value

string version

at line 84
public string getStability()

Returns the stability of this package: one of (dev, alpha, beta, RC, stable)

Return Value

string

at line 92
public string getPrettyVersion()

Returns the pretty (i.e.

non-normalized) version string of this package

Return Value

string version

at line 100
public bool isDev()

Returns whether the package is a development virtual package or a concrete one

Return Value

bool

at line 108
public Link[] getRequires()

Returns a set of links to packages which need to be installed before this package can be installed

Return Value

Link[] An array of package links defining required packages

at line 116
public Link[] getConflicts()

Returns a set of links to packages which must not be installed at the same time as this package

Return Value

Link[] An array of package links defining conflicting packages

at line 124
public Link[] getProvides()

Returns a set of links to virtual packages that are provided through this package

Return Value

Link[] An array of package links defining provided packages

at line 132
public Link[] getReplaces()

Returns a set of links to packages which can alternatively be satisfied by installing this package

Return Value

Link[] An array of package links defining replaced packages

at line 140
public Link[] getDevRequires()

Returns a set of links to packages which are required to develop this package.

These are installed if in dev mode.

Return Value

Link[] An array of package links defining packages required for development

at line 154
public mixed setRootPackageAlias(bool $value)

Stores whether this is an alias created by an aliasing in the requirements of the root package or not

Use by the policy for sorting manually aliased packages first, see #576

Parameters

bool $value

Return Value

mixed

at line 163
public bool isRootPackageAlias()

Return Value

bool

See also

setRootPackageAlias

at line 200
public string getType()

Returns the package type, e.g.

library

Return Value

string The package type

at line 205
public string getTargetDir()

Returns the package targetDir property

Return Value

string The package targetDir

at line 210
public array getExtra()

Returns the package extra data

Return Value

array The package extra data

at line 215
public setInstallationSource(string $type)

Sets source from which this package was installed (source/dist).

Parameters

string $type source/dist

at line 220
public string getInstallationSource()

Returns source from which this package was installed (source/dist).

Return Value

string source/dist

at line 225
public string getSourceType()

Returns the repository type of this package, e.g.

git, svn

Return Value

string The repository type

at line 230
public string getSourceUrl()

Returns the repository url of this package, e.g.

git://github.com/naderman/composer.git

Return Value

string The repository url

at line 235
public array getSourceUrls()

Returns the repository urls of this package including mirrors, e.g.

git://github.com/naderman/composer.git

Return Value

array

at line 240
public string getSourceReference()

Returns the repository reference of this package, e.g.

master, 1.0.0 or a commit hash for git

Return Value

string The repository reference

at line 245
public setSourceReference($reference)

Parameters

$reference

at line 250
public setSourceMirrors($mirrors)

Parameters

$mirrors

at line 255
public array|null getSourceMirrors()

Returns the source mirrors of this package

Return Value

array|null

at line 260
public string getDistType()

Returns the type of the distribution archive of this version, e.g.

zip, tarball

Return Value

string The repository type

at line 265
public string getDistUrl()

Returns the url of the distribution archive of this version

Return Value

string

at line 270
public array getDistUrls()

Returns the urls of the distribution archive of this version, including mirrors

Return Value

array

at line 275
public string getDistReference()

Returns the reference of the distribution archive of this version, e.g.

master, 1.0.0 or a commit hash for git

Return Value

string

at line 280
public setDistReference($reference)

Parameters

$reference

at line 285
public string getDistSha1Checksum()

Returns the sha1 checksum for the distribution archive of this version

Return Value

string

at line 300
public setDistMirrors($mirrors)

Parameters

$mirrors

at line 305
public array|null getDistMirrors()

Returns the dist mirrors of this package

Return Value

array|null

at line 310
public array getScripts()

Returns the scripts of this package

Return Value

array array('script name' => array('listeners'))

at line 315
public array getLicense()

Returns the package license, e.g.

MIT, BSD, GPL

Return Value

array The package licenses

at line 320
public array getAutoload()

Returns an associative array of autoloading rules

{"": {"<namespace": ""}}

Type is either "psr-4", "psr-0", "classmap" or "files". Namespaces are mapped to directories for autoloading using the type specified.

Return Value

array Mapping of autoloading rules

at line 325
public array getDevAutoload()

Returns an associative array of dev autoloading rules

{"": {"<namespace": ""}}

Type is either "psr-4", "psr-0", "classmap" or "files". Namespaces are mapped to directories for autoloading using the type specified.

Return Value

array Mapping of dev autoloading rules

at line 330
public array getIncludePaths()

Returns a list of directories which should get added to PHP's include path.

Return Value

array

at line 335
public array getRepositories()

Returns an array of repositories

{"": {}}

Return Value

array Repositories

at line 340
public DateTime getReleaseDate()

Returns the release date of the package

Return Value

DateTime

at line 345
public array getBinaries()

Returns the package binaries

Return Value

array

at line 350
public array getKeywords()

Returns an array of keywords relating to the package

Return Value

array

at line 355
public string getDescription()

Returns the package description

Return Value

string

at line 360
public string getHomepage()

Returns the package homepage

Return Value

string

at line 365
public array getSuggests()

Returns a set of package names and reasons why they are useful in combination with this package.

Return Value

array An array of package suggestions with descriptions

at line 370
public array getAuthors()

Returns an array of authors of the package

Each item can contain name/homepage/email keys

Return Value

array

at line 375
public array getSupport()

Returns the support information

Return Value

array

at line 380
public string getNotificationUrl()

Returns the package notification url

Return Value

string

at line 385
public array getArchiveExcludes()

Returns a list of patterns to exclude from package archives

Return Value

array

at line 390
public bool isAbandoned()

Returns if the package is abandoned or not

Return Value

bool

at line 395
public string getReplacementPackage()

If the package is abandoned and has a suggested replacement, this method returns it

Return Value

string