\Composer\PackageRootPackage

The root package represents the project's composer.json and contains additional metadata

Summary

Methods
Properties
Constants
setScripts()
getScripts()
setRepositories()
getRepositories()
setLicense()
getLicense()
setKeywords()
getKeywords()
setAuthors()
getAuthors()
setDescription()
getDescription()
setHomepage()
getHomepage()
setSupport()
getSupport()
isAbandoned()
setAbandoned()
getReplacementPackage()
__construct()
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()
getName()
getPrettyName()
getNames()
setId()
getId()
setRepository()
getRepository()
getTransportOptions()
setTransportOptions()
isPlatform()
getUniqueName()
equals()
__toString()
getPrettyString()
getFullPrettyVersion()
getStabilityPriority()
__clone()
setMinimumStability()
getMinimumStability()
setStabilityFlags()
getStabilityFlags()
setPreferStable()
getPreferStable()
setConfig()
getConfig()
setReferences()
getReferences()
setAliases()
getAliases()
$supportedLinkTypes
$stabilities
$id
STABILITY_STABLE
STABILITY_RC
STABILITY_BETA
STABILITY_ALPHA
STABILITY_DEV
getUrls()
$repositories
$license
$keywords
$authors
$description
$homepage
$scripts
$support
$abandoned
$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
$name
$prettyName
$repository
$transportOptions
$minimumStability
$preferStable
$stabilityFlags
$config
$references
$aliases
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

$repositories

$repositories : 

Type

$license

$license : 

Type

$keywords

$keywords : 

Type

$authors

$authors : 

Type

$description

$description : 

Type

$homepage

$homepage : 

Type

$scripts

$scripts : 

Type

$support

$support : 

Type

$abandoned

$abandoned : 

Type

$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

$name

$name : string

Type

string

$prettyName

$prettyName : string

Type

string

$transportOptions

$transportOptions : array

Type

array

$minimumStability

$minimumStability : 

Type

$preferStable

$preferStable : 

Type

$stabilityFlags

$stabilityFlags : 

Type

$config

$config : 

Type

$references

$references : 

Type

$aliases

$aliases : 

Type

Methods

setScripts()

setScripts(array  $scripts) 

Parameters

array $scripts

getScripts()

getScripts() : array

Returns the scripts of this package

Returns

array —

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

setRepositories()

setRepositories(array  $repositories) 

Set the repositories

Parameters

array $repositories

getRepositories()

getRepositories() : array

Returns an array of repositories

{"": {<config key/values>}}

Returns

array —

Repositories

setLicense()

setLicense(array  $license) 

Set the license

Parameters

array $license

getLicense()

getLicense() : array

Returns the package license, e.g. MIT, BSD, GPL

Returns

array —

The package licenses

setKeywords()

setKeywords(array  $keywords) 

Set the keywords

Parameters

array $keywords

getKeywords()

getKeywords() : array

Returns an array of keywords relating to the package

Returns

array

setAuthors()

setAuthors(array  $authors) 

Set the authors

Parameters

array $authors

getAuthors()

getAuthors() : array

Returns an array of authors of the package

Each item can contain name/homepage/email keys

Returns

array

setDescription()

setDescription(string  $description) 

Set the description

Parameters

string $description

getDescription()

getDescription() : string

Returns the package description

Returns

string

setHomepage()

setHomepage(string  $homepage) 

Set the homepage

Parameters

string $homepage

getHomepage()

getHomepage() : string

Returns the package homepage

Returns

string

setSupport()

setSupport(array  $support) 

Set the support information

Parameters

array $support

getSupport()

getSupport() : array

Returns the support information

Returns

array

isAbandoned()

isAbandoned() : boolean

Returns if the package is abandoned or not

Returns

boolean

setAbandoned()

setAbandoned(boolean|string  $abandoned) 

Parameters

boolean|string $abandoned

getReplacementPackage()

getReplacementPackage() : string|null

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

Returns

string|null

__construct()

__construct(string  $name) 

All descendants' constructors should call this parent constructor

Parameters

string $name

The package's name

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

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() 

setMinimumStability()

setMinimumStability(string  $minimumStability) 

Set the minimumStability

Parameters

string $minimumStability

getMinimumStability()

getMinimumStability() : string

Returns the minimum stability of the package

Returns

string

setStabilityFlags()

setStabilityFlags(array  $stabilityFlags) 

Set the stabilityFlags

Parameters

array $stabilityFlags

getStabilityFlags()

getStabilityFlags() : array

Returns the stability flags to apply to dependencies

array('foo/bar' => 'dev')

Returns

array

setPreferStable()

setPreferStable(boolean  $preferStable) 

Set the preferStable

Parameters

boolean $preferStable

getPreferStable()

getPreferStable() : boolean

Returns true if the root package prefers picking stable packages over unstable ones

Returns

boolean

setConfig()

setConfig(array  $config) 

Set the config

Parameters

array $config

getConfig()

getConfig() : array

Returns the root package's configuration

Returns

array

setReferences()

setReferences(array  $references) 

Set the references

Parameters

array $references

getReferences()

getReferences() : array

Returns a set of package names and source references that must be enforced on them

array('foo/bar' => 'abcd1234')

Returns

array

setAliases()

setAliases(array  $aliases) 

Set the aliases

Parameters

array $aliases

getAliases()

getAliases() : array

Returns a set of package names and their aliases

Returns

array

getUrls()

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

Parameters

$url
$mirrors
$ref
$type
$urlType