\Composer\PackagePackage

Core package definitions that are needed to resolve dependencies and install packages

Summary

Methods
Properties
Constants
__construct()
getName()
getPrettyName()
getNames()
setId()
getId()
setRepository()
getRepository()
getTransportOptions()
setTransportOptions()
isPlatform()
getUniqueName()
equals()
__toString()
getPrettyString()
getFullPrettyVersion()
getStabilityPriority()
__clone()
isDev()
setType()
getType()
getStability()
setTargetDir()
getTargetDir()
setExtra()
getExtra()
setBinaries()
getBinaries()
setInstallationSource()
getInstallationSource()
setSourceType()
getSourceType()
setSourceUrl()
getSourceUrl()
setSourceReference()
getSourceReference()
setSourceMirrors()
getSourceMirrors()
getSourceUrls()
setDistType()
getDistType()
setDistUrl()
getDistUrl()
setDistReference()
getDistReference()
setDistSha1Checksum()
getDistSha1Checksum()
setDistMirrors()
getDistMirrors()
getDistUrls()
getVersion()
getPrettyVersion()
setReleaseDate()
getReleaseDate()
setRequires()
getRequires()
setConflicts()
getConflicts()
setProvides()
getProvides()
setReplaces()
getReplaces()
setDevRequires()
getDevRequires()
setSuggests()
getSuggests()
setAutoload()
getAutoload()
setDevAutoload()
getDevAutoload()
setIncludePaths()
getIncludePaths()
setNotificationUrl()
getNotificationUrl()
setArchiveExcludes()
getArchiveExcludes()
replaceVersion()
$supportedLinkTypes
$stabilities
$id
STABILITY_STABLE
STABILITY_RC
STABILITY_BETA
STABILITY_ALPHA
STABILITY_DEV
getUrls()
$name
$prettyName
$repository
$transportOptions
$type
$targetDir
$installationSource
$sourceType
$sourceUrl
$sourceReference
$sourceMirrors
$distType
$distUrl
$distReference
$distSha1Checksum
$distMirrors
$version
$prettyVersion
$releaseDate
$extra
$binaries
$dev
$stability
$notificationUrl
$requires
$conflicts
$provides
$replaces
$devRequires
$suggests
$autoload
$devAutoload
$includePaths
$archiveExcludes
N/A
No private methods found
No private properties found
N/A

Constants

STABILITY_STABLE

STABILITY_STABLE = 0

STABILITY_RC

STABILITY_RC = 5

STABILITY_BETA

STABILITY_BETA = 10

STABILITY_ALPHA

STABILITY_ALPHA = 15

STABILITY_DEV

STABILITY_DEV = 20

Properties

$supportedLinkTypes

$supportedLinkTypes : 

Type

$stabilities

$stabilities : 

Type

$id

$id : integer

READ-ONLY: The package id, public for fast access in dependency solver

Type

integer

$name

$name : string

Type

string

$prettyName

$prettyName : string

Type

string

$transportOptions

$transportOptions : array

Type

array

$type

$type : 

Type

$targetDir

$targetDir : 

Type

$installationSource

$installationSource : 

Type

$sourceType

$sourceType : 

Type

$sourceUrl

$sourceUrl : 

Type

$sourceReference

$sourceReference : 

Type

$sourceMirrors

$sourceMirrors : 

Type

$distType

$distType : 

Type

$distUrl

$distUrl : 

Type

$distReference

$distReference : 

Type

$distSha1Checksum

$distSha1Checksum : 

Type

$distMirrors

$distMirrors : 

Type

$version

$version : 

Type

$prettyVersion

$prettyVersion : 

Type

$releaseDate

$releaseDate : 

Type

$extra

$extra : 

Type

$binaries

$binaries : 

Type

$dev

$dev : 

Type

$stability

$stability : 

Type

$notificationUrl

$notificationUrl : 

Type

$suggests

$suggests : 

Type

$autoload

$autoload : 

Type

$devAutoload

$devAutoload : 

Type

$includePaths

$includePaths : 

Type

$archiveExcludes

$archiveExcludes : 

Type

Methods

__construct()

__construct(string  $name, string  $version, string  $prettyVersion) 

Creates a new in memory package.

Parameters

string $name

The package's name

string $version

The package's version

string $prettyVersion

The package's non-normalized version

getName()

getName() : string

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

Returns

string —

package name

getPrettyName()

getPrettyName() : string

Returns the package's pretty (i.e. with proper case) name

Returns

string —

package name

getNames()

getNames() : array

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.

Returns

array —

An array of strings referring to this package

setId()

setId(integer  $id) 

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

Parameters

integer $id

getId()

getId() : integer

Retrieves the package's id set through setId

Returns

integer —

The previously set package id

setRepository()

setRepository(\Composer\Repository\RepositoryInterface  $repository) 

Stores a reference to the repository that owns the package

Parameters

\Composer\Repository\RepositoryInterface $repository

getTransportOptions()

getTransportOptions() : array

Returns a list of options to download package dist files

Returns

array

setTransportOptions()

setTransportOptions(array  $options) 

Configures the list of options to download package dist files

Parameters

array $options

isPlatform()

isPlatform() : boolean

checks if this package is a platform package

Returns

boolean

getUniqueName()

getUniqueName() : string

Returns package unique name, constructed from name, version and release type.

Returns

string

__toString()

__toString() : string

Converts the package into a readable and unique string

Returns

string

getPrettyString()

getPrettyString() : string

Converts the package into a pretty readable string

Returns

string

getFullPrettyVersion()

getFullPrettyVersion(boolean  $truncate = true) : string

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

Parameters

boolean $truncate

If the source reference is a sha1 hash, truncate it

Returns

string —

version

getStabilityPriority()

getStabilityPriority() 

__clone()

__clone() 

isDev()

isDev() 

{@inheritDoc}

setType()

setType(string  $type) 

Parameters

string $type

getType()

getType() 

{@inheritDoc}

getStability()

getStability() 

{@inheritDoc}

setTargetDir()

setTargetDir(string  $targetDir) 

Parameters

string $targetDir

getTargetDir()

getTargetDir() 

{@inheritDoc}

setExtra()

setExtra(array  $extra) 

Parameters

array $extra

getExtra()

getExtra() 

{@inheritDoc}

setBinaries()

setBinaries(array  $binaries) 

Parameters

array $binaries

getBinaries()

getBinaries() 

{@inheritDoc}

setInstallationSource()

setInstallationSource(  $type) 

{@inheritDoc}

Parameters

$type

getInstallationSource()

getInstallationSource() 

{@inheritDoc}

setSourceType()

setSourceType(string  $type) 

Parameters

string $type

getSourceType()

getSourceType() 

{@inheritDoc}

setSourceUrl()

setSourceUrl(string  $url) 

Parameters

string $url

getSourceUrl()

getSourceUrl() 

{@inheritDoc}

setSourceReference()

setSourceReference(string  $reference) 

Parameters

string $reference

getSourceReference()

getSourceReference() 

{@inheritDoc}

setSourceMirrors()

setSourceMirrors(array|null  $mirrors) 

Parameters

array|null $mirrors

getSourceMirrors()

getSourceMirrors() 

{@inheritDoc}

getSourceUrls()

getSourceUrls() 

{@inheritDoc}

setDistType()

setDistType(string  $type) 

Parameters

string $type

getDistType()

getDistType() 

{@inheritDoc}

setDistUrl()

setDistUrl(string  $url) 

Parameters

string $url

getDistUrl()

getDistUrl() 

{@inheritDoc}

setDistReference()

setDistReference(string  $reference) 

Parameters

string $reference

getDistReference()

getDistReference() 

{@inheritDoc}

setDistSha1Checksum()

setDistSha1Checksum(string  $sha1checksum) 

Parameters

string $sha1checksum

getDistSha1Checksum()

getDistSha1Checksum() 

{@inheritDoc}

setDistMirrors()

setDistMirrors(array|null  $mirrors) 

Parameters

array|null $mirrors

getDistMirrors()

getDistMirrors() 

{@inheritDoc}

getDistUrls()

getDistUrls() 

{@inheritDoc}

getVersion()

getVersion() 

{@inheritDoc}

getPrettyVersion()

getPrettyVersion() 

{@inheritDoc}

setReleaseDate()

setReleaseDate(\DateTime  $releaseDate) 

Set the releaseDate

Parameters

\DateTime $releaseDate

getReleaseDate()

getReleaseDate() 

{@inheritDoc}

setRequires()

setRequires(array<mixed,\Composer\Package\Link>  $requires) 

Set the required packages

Parameters

array<mixed,\Composer\Package\Link> $requires

A set of package links

getRequires()

getRequires() 

{@inheritDoc}

setConflicts()

setConflicts(array<mixed,\Composer\Package\Link>  $conflicts) 

Set the conflicting packages

Parameters

array<mixed,\Composer\Package\Link> $conflicts

A set of package links

getConflicts()

getConflicts() 

{@inheritDoc}

setProvides()

setProvides(array<mixed,\Composer\Package\Link>  $provides) 

Set the provided virtual packages

Parameters

array<mixed,\Composer\Package\Link> $provides

A set of package links

getProvides()

getProvides() 

{@inheritDoc}

setReplaces()

setReplaces(array<mixed,\Composer\Package\Link>  $replaces) 

Set the packages this one replaces

Parameters

array<mixed,\Composer\Package\Link> $replaces

A set of package links

getReplaces()

getReplaces() 

{@inheritDoc}

setDevRequires()

setDevRequires(array<mixed,\Composer\Package\Link>  $devRequires) 

Set the recommended packages

Parameters

array<mixed,\Composer\Package\Link> $devRequires

A set of package links

getDevRequires()

getDevRequires() 

{@inheritDoc}

setSuggests()

setSuggests(array  $suggests) 

Set the suggested packages

Parameters

array $suggests

A set of package names/comments

getSuggests()

getSuggests() 

{@inheritDoc}

setAutoload()

setAutoload(array  $autoload) 

Set the autoload mapping

Parameters

array $autoload

Mapping of autoloading rules

getAutoload()

getAutoload() 

{@inheritDoc}

setDevAutoload()

setDevAutoload(array  $devAutoload) 

Set the dev autoload mapping

Parameters

array $devAutoload

Mapping of dev autoloading rules

getDevAutoload()

getDevAutoload() 

{@inheritDoc}

setIncludePaths()

setIncludePaths(array  $includePaths) 

Sets the list of paths added to PHP's include path.

Parameters

array $includePaths

List of directories.

getIncludePaths()

getIncludePaths() 

{@inheritDoc}

setNotificationUrl()

setNotificationUrl(string  $notificationUrl) 

Sets the notification URL

Parameters

string $notificationUrl

getNotificationUrl()

getNotificationUrl() 

{@inheritDoc}

setArchiveExcludes()

setArchiveExcludes(array  $excludes) 

Sets a list of patterns to be excluded from archives

Parameters

array $excludes

getArchiveExcludes()

getArchiveExcludes() 

{@inheritDoc}

replaceVersion()

replaceVersion(string  $version, string  $prettyVersion) 

Replaces current version and pretty version with passed values.

It also sets stability.

Parameters

string $version

The package's normalized version

string $prettyVersion

The package's non-normalized version

getUrls()

getUrls(  $url,   $mirrors,   $ref,   $type,   $urlType) 

Parameters

$url
$mirrors
$ref
$type
$urlType