Composer API
Interface

Composer\Package\RootPackageInterface

interface RootPackageInterface implements CompletePackageInterface

Defines additional fields that are only needed for the root package

Methods

string getName()

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

from PackageInterface
string getPrettyName()

Returns the package's pretty (i.e.

from PackageInterface
array getNames()

Returns a set of names that could refer to this package

from PackageInterface
setId(int $id)

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

from PackageInterface
int getId()

Retrieves the package's id set through setId

from PackageInterface
bool isDev()

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

from PackageInterface
string getType()

Returns the package type, e.g.

from PackageInterface
string getTargetDir()

Returns the package targetDir property

from PackageInterface
array getExtra()

Returns the package extra data

from PackageInterface
setInstallationSource(string $type)

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

from PackageInterface
string getInstallationSource()

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

from PackageInterface
string getSourceType()

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

from PackageInterface
string getSourceUrl()

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

from PackageInterface
array getSourceUrls()

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

from PackageInterface
string getSourceReference()

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

from PackageInterface
array|null getSourceMirrors()

Returns the source mirrors of this package

from PackageInterface
string getDistType()

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

from PackageInterface
string getDistUrl()

Returns the url of the distribution archive of this version

from PackageInterface
array getDistUrls()

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

from PackageInterface
string getDistReference()

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

from PackageInterface
string getDistSha1Checksum()

Returns the sha1 checksum for the distribution archive of this version

from PackageInterface
array|null getDistMirrors()

Returns the dist mirrors of this package

from PackageInterface
string getVersion()

Returns the version of this package

from PackageInterface
string getPrettyVersion()

Returns the pretty (i.e.

from PackageInterface
string getFullPrettyVersion(bool $truncate = true)

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

from PackageInterface
DateTime getReleaseDate()

Returns the release date of the package

from PackageInterface
string getStability()

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

from PackageInterface
Link[] getRequires()

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

from PackageInterface
Link[] getConflicts()

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

from PackageInterface
Link[] getProvides()

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

from PackageInterface
Link[] getReplaces()

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

from PackageInterface
Link[] getDevRequires()

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

from PackageInterface
array getSuggests()

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

from PackageInterface
array getAutoload()

Returns an associative array of autoloading rules

from PackageInterface
array getDevAutoload()

Returns an associative array of dev autoloading rules

from PackageInterface
array getIncludePaths()

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

from PackageInterface
setRepository(RepositoryInterface $repository)

Stores a reference to the repository that owns the package

from PackageInterface
RepositoryInterface getRepository()

Returns a reference to the repository that owns the package

from PackageInterface
array getBinaries()

Returns the package binaries

from PackageInterface
string getUniqueName()

Returns package unique name, constructed from name and version.

from PackageInterface
string getNotificationUrl()

Returns the package notification url

from PackageInterface
string __toString()

Converts the package into a readable and unique string

from PackageInterface
string getPrettyString()

Converts the package into a pretty readable string

from PackageInterface
array getArchiveExcludes()

Returns a list of patterns to exclude from package archives

from PackageInterface
array getTransportOptions()

Returns a list of options to download package dist files

from PackageInterface
array getScripts()

Returns the scripts of this package

from CompletePackageInterface
array getRepositories()

Returns an array of repositories

from CompletePackageInterface
array getLicense()

Returns the package license, e.g.

from CompletePackageInterface
array getKeywords()

Returns an array of keywords relating to the package

from CompletePackageInterface
string getDescription()

Returns the package description

from CompletePackageInterface
string getHomepage()

Returns the package homepage

from CompletePackageInterface
array getAuthors()

Returns an array of authors of the package

from CompletePackageInterface
array getSupport()

Returns the support information

from CompletePackageInterface
bool isAbandoned()

Returns if the package is abandoned or not

from CompletePackageInterface
string getReplacementPackage()

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

from CompletePackageInterface
array getAliases()

Returns a set of package names and their aliases

string getMinimumStability()

Returns the minimum stability of the package

array getStabilityFlags()

Returns the stability flags to apply to dependencies

array getReferences()

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

bool getPreferStable()

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

array getConfig()

Returns the root package's configuration

setRequires(array $requires)

Set the required packages

setDevRequires(array $devRequires)

Set the recommended packages

setConflicts(array $conflicts)

Set the conflicting packages

setProvides(array $provides)

Set the provided virtual packages

setReplaces(array $replaces)

Set the packages this one replaces

setRepositories(array $repositories)

Set the repositories

setAutoload(array $autoload)

Set the autoload mapping

setDevAutoload(array $devAutoload)

Set the dev autoload mapping

setStabilityFlags(array $stabilityFlags)

Set the stabilityFlags

setSuggests(array $suggests)

Set the suggested packages

setExtra(array $extra)

Details

in PackageInterface at line 29
public string getName()

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

Return Value

string package name

in PackageInterface at line 36
public string getPrettyName()

Returns the package's pretty (i.e.

with proper case) name

Return Value

string package name

in PackageInterface at line 46
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 PackageInterface at line 53
public setId(int $id)

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

Parameters

int $id

in PackageInterface at line 60
public int getId()

Retrieves the package's id set through setId

Return Value

int The previously set package id

in PackageInterface at line 67
public bool isDev()

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

Return Value

bool

in PackageInterface at line 74
public string getType()

Returns the package type, e.g.

library

Return Value

string The package type

in PackageInterface at line 81
public string getTargetDir()

Returns the package targetDir property

Return Value

string The package targetDir

in PackageInterface at line 88
public array getExtra()

Returns the package extra data

Return Value

array The package extra data

in PackageInterface at line 95
public setInstallationSource(string $type)

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

Parameters

string $type source/dist

in PackageInterface at line 102
public string getInstallationSource()

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

Return Value

string source/dist

in PackageInterface at line 109
public string getSourceType()

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

git, svn

Return Value

string The repository type

in PackageInterface at line 116
public string getSourceUrl()

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

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

Return Value

string The repository url

in PackageInterface at line 123
public array getSourceUrls()

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

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

Return Value

array

in PackageInterface at line 130
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

in PackageInterface at line 137
public array|null getSourceMirrors()

Returns the source mirrors of this package

Return Value

array|null

in PackageInterface at line 144
public string getDistType()

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

zip, tarball

Return Value

string The repository type

in PackageInterface at line 151
public string getDistUrl()

Returns the url of the distribution archive of this version

Return Value

string

in PackageInterface at line 158
public array getDistUrls()

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

Return Value

array

in PackageInterface at line 165
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

in PackageInterface at line 172
public string getDistSha1Checksum()

Returns the sha1 checksum for the distribution archive of this version

Return Value

string

in PackageInterface at line 179
public array|null getDistMirrors()

Returns the dist mirrors of this package

Return Value

array|null

in PackageInterface at line 186
public string getVersion()

Returns the version of this package

Return Value

string version

in PackageInterface at line 193
public string getPrettyVersion()

Returns the pretty (i.e.

non-normalized) version string of this package

Return Value

string version

in PackageInterface at line 203
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

See also

getPrettyVersion

in PackageInterface at line 210
public DateTime getReleaseDate()

Returns the release date of the package

Return Value

DateTime

in PackageInterface at line 217
public string getStability()

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

Return Value

string

in PackageInterface at line 225
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

in PackageInterface at line 233
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

in PackageInterface at line 241
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

in PackageInterface at line 249
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

in PackageInterface at line 257
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

in PackageInterface at line 265
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

in PackageInterface at line 277
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

in PackageInterface at line 289
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

in PackageInterface at line 297
public array getIncludePaths()

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

Return Value

array

in PackageInterface at line 304
public setRepository(RepositoryInterface $repository)

Stores a reference to the repository that owns the package

Parameters

RepositoryInterface $repository

in PackageInterface at line 311
public RepositoryInterface getRepository()

Returns a reference to the repository that owns the package

Return Value

RepositoryInterface

in PackageInterface at line 318
public array getBinaries()

Returns the package binaries

Return Value

array

in PackageInterface at line 325
public string getUniqueName()

Returns package unique name, constructed from name and version.

Return Value

string

in PackageInterface at line 332
public string getNotificationUrl()

Returns the package notification url

Return Value

string

in PackageInterface at line 339
public string __toString()

Converts the package into a readable and unique string

Return Value

string

in PackageInterface at line 346
public string getPrettyString()

Converts the package into a pretty readable string

Return Value

string

in PackageInterface at line 353
public array getArchiveExcludes()

Returns a list of patterns to exclude from package archives

Return Value

array

in PackageInterface at line 360
public array getTransportOptions()

Returns a list of options to download package dist files

Return Value

array

public array getScripts()

Returns the scripts of this package

Return Value

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

public array getRepositories()

Returns an array of repositories

{"": {}}

Return Value

array Repositories

public array getLicense()

Returns the package license, e.g.

MIT, BSD, GPL

Return Value

array The package licenses

public array getKeywords()

Returns an array of keywords relating to the package

Return Value

array

public string getDescription()

Returns the package description

Return Value

string

public string getHomepage()

Returns the package homepage

Return Value

string

public array getAuthors()

Returns an array of authors of the package

Each item can contain name/homepage/email keys

Return Value

array

public array getSupport()

Returns the support information

Return Value

array

public bool isAbandoned()

Returns if the package is abandoned or not

Return Value

bool

public string getReplacementPackage()

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

Return Value

string

at line 27
public array getAliases()

Returns a set of package names and their aliases

Return Value

array

at line 34
public string getMinimumStability()

Returns the minimum stability of the package

Return Value

string

at line 43
public array getStabilityFlags()

Returns the stability flags to apply to dependencies

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

Return Value

array

at line 52
public array getReferences()

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

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

Return Value

array

at line 59
public bool getPreferStable()

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

Return Value

bool

at line 66
public array getConfig()

Returns the root package's configuration

Return Value

array

at line 73
public setRequires(array $requires)

Set the required packages

Parameters

array $requires A set of package links

at line 80
public setDevRequires(array $devRequires)

Set the recommended packages

Parameters

array $devRequires A set of package links

at line 87
public setConflicts(array $conflicts)

Set the conflicting packages

Parameters

array $conflicts A set of package links

at line 94
public setProvides(array $provides)

Set the provided virtual packages

Parameters

array $provides A set of package links

at line 101
public setReplaces(array $replaces)

Set the packages this one replaces

Parameters

array $replaces A set of package links

at line 108
public setRepositories(array $repositories)

Set the repositories

Parameters

array $repositories

at line 115
public setAutoload(array $autoload)

Set the autoload mapping

Parameters

array $autoload Mapping of autoloading rules

at line 122
public setDevAutoload(array $devAutoload)

Set the dev autoload mapping

Parameters

array $devAutoload Mapping of dev autoloading rules

at line 129
public setStabilityFlags(array $stabilityFlags)

Set the stabilityFlags

Parameters

array $stabilityFlags

at line 136
public setSuggests(array $suggests)

Set the suggested packages

Parameters

array $suggests A set of package names/comments

at line 141
public setExtra(array $extra)

Parameters

array $extra