Composer API
Class

Composer\Package\MemoryPackage

class MemoryPackage extends BasePackage

A package with setters for all members to create it dynamically in memory

Constants

STABILITY_STABLE

STABILITY_RC

STABILITY_BETA

STABILITY_ALPHA

STABILITY_DEV

MATCH_NAME

MATCH_NONE

MATCH

MATCH_PROVIDE

MATCH_REPLACE

Properties

static $supportedLinkTypes
static $stabilities

Methods

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

Creates a new in memory package.

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
int matches(string $name, LinkConstraintInterface $constraint)

Checks if the package matches the given constraint directly or through provided or replaced packages

from BasePackage
RepositoryInterface getRepository()

Returns a reference to the repository that owns the package

from BasePackage
setRepository(RepositoryInterface $repository)

Stores a reference to the repository that owns the package

from BasePackage
boolean isPlatform()

checks if this package is a platform package

from BasePackage
string getUniqueName()

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

from BasePackage
equals(PackageInterface $package)

from BasePackage
string __toString()

Converts the package into a readable and unique string

from BasePackage
string getPrettyString()

Converts the package into a pretty readable string

from BasePackage
__clone()

from BasePackage
bool isDev()

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

setType(string $type)

string getType()

Returns the package type, e.g.

string getStability()

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

setTargetDir(string $targetDir)

string getTargetDir()

Returns the package targetDir property

setExtra(array $extra)

array getExtra()

Returns the package extra data

setBinaries(array $binaries)

array getBinaries()

Returns the package binaries

setScripts(array $scripts)

array getScripts()

Returns the scripts of this package

setAliases(array $aliases)

getAliases()

{@inheritDoc}

setAlias(string $alias)

string getAlias()

Returns a version this package should be aliased to

setPrettyAlias(string $prettyAlias)

string getPrettyAlias()

Returns a non-normalized version this package should be aliased to

setInstallationSource(string $type)

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

getInstallationSource()

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

setSourceType(string $type)

string getSourceType()

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

setSourceUrl(string $url)

string getSourceUrl()

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

setSourceReference(string $reference)

string getSourceReference()

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

setDistType(string $type)

string getDistType()

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

setDistUrl(string $url)

string getDistUrl()

Returns the url of the distribution archive of this version

setDistReference(string $reference)

string getDistReference()

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

setDistSha1Checksum(string $sha1checksum)

string getDistSha1Checksum()

Returns the sha1 checksum for the distribution archive of this version

setRepositories(string $repositories)

Set the repositories

array getRepositories()

Returns an array of repositories

string getVersion()

Returns the version of this package

string getPrettyVersion()

Returns the pretty (i.e.

setLicense(array $license)

Set the license

array getLicense()

Returns the package license, e.g.

setRequires(array $requires)

Set the required packages

array getRequires()

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

setConflicts(array $conflicts)

Set the conflicting packages

array getConflicts()

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

setProvides(array $provides)

Set the provided virtual packages

array getProvides()

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

setReplaces(array $replaces)

Set the packages this one replaces

array getReplaces()

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

setDevRequires(array $devRequires)

Set the recommended packages

array getDevRequires()

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

setSuggests(array $suggests)

Set the suggested packages

array getSuggests()

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

setReleaseDate(DateTime $releaseDate)

Set the releaseDate

DateTime getReleaseDate()

Returns the release date of the package

setKeywords(array $keywords)

Set the keywords

array getKeywords()

Returns an array of keywords relating to the package

setAuthors(array $authors)

Set the authors

array getAuthors()

Returns an array of authors of the package

setDescription(string $description)

Set the description

string getDescription()

Returns the package description

setHomepage(string $homepage)

Set the homepage

string getHomepage()

Returns the package homepage

setMinimumStability(string $minimumStability)

Set the minimumStability

getMinimumStability()

{@inheritDoc}

setStabilityFlags(array $stabilityFlags)

Set the stabilityFlags

getStabilityFlags()

{@inheritDoc}

setReferences(array $references)

Set the references

getReferences()

{@inheritDoc}

setAutoload(array $autoload)

Set the autoload mapping

array getAutoload()

Returns an associative array of autoloading rules

setIncludePaths(array $includePaths)

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

array getIncludePaths()

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

setSupport(array $support)

Set the support information

array getSupport()

Returns the support information

Details

at line 72
public __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

in BasePackage at line 76
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 84
public string getPrettyName()

Returns the package's pretty (i.e.

with proper case) name

Return Value

string package name

in BasePackage at line 92
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 112
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 120
public int getId()

Retrieves the package's id set through setId

Return Value

int The previously set package id

in BasePackage at line 133
public int matches(string $name, LinkConstraintInterface $constraint)

Checks if the package matches the given constraint directly or through provided or replaced packages

Parameters

string $name Name of the package to be matched
LinkConstraintInterface $constraint The constraint to verify

Return Value

int One of the MATCH* constants of this class or 0 if there is no match

in BasePackage at line 154
public RepositoryInterface getRepository()

Returns a reference to the repository that owns the package

Return Value

RepositoryInterface

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

Stores a reference to the repository that owns the package

Parameters

RepositoryInterface $repository

in BasePackage at line 172
public boolean isPlatform()

checks if this package is a platform package

Return Value

boolean

in BasePackage at line 182
public string getUniqueName()

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

Return Value

string

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

Parameters

PackageInterface $package

in BasePackage at line 205
public string __toString()

Converts the package into a readable and unique string

Return Value

string

in BasePackage at line 210
public string getPrettyString()

Converts the package into a pretty readable string

Return Value

string

in BasePackage at line 215
public __clone()

at line 86
public bool isDev()

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

Return Value

bool

at line 94
public setType(string $type)

Parameters

string $type

at line 102
public string getType()

Returns the package type, e.g.

library

Return Value

string The package type

at line 110
public string getStability()

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

Return Value

string

at line 118
public setTargetDir(string $targetDir)

Parameters

string $targetDir

at line 126
public string getTargetDir()

Returns the package targetDir property

Return Value

string The package targetDir

at line 134
public setExtra(array $extra)

Parameters

array $extra

at line 142
public array getExtra()

Returns the package extra data

Return Value

array The package extra data

at line 150
public setBinaries(array $binaries)

Parameters

array $binaries

at line 158
public array getBinaries()

Returns the package binaries

Return Value

array

at line 166
public setScripts(array $scripts)

Parameters

array $scripts

at line 174
public array getScripts()

Returns the scripts of this package

Return Value

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

at line 182
public setAliases(array $aliases)

Parameters

array $aliases

at line 190
public getAliases()

{@inheritDoc}

at line 198
public setAlias(string $alias)

Parameters

string $alias

at line 206
public string getAlias()

Returns a version this package should be aliased to

Return Value

string

at line 214
public setPrettyAlias(string $prettyAlias)

Parameters

string $prettyAlias

at line 222
public string getPrettyAlias()

Returns a non-normalized version this package should be aliased to

Return Value

string

at line 230
public setInstallationSource(string $type)

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

Parameters

string $type source/dist

at line 238
public getInstallationSource()

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

at line 246
public setSourceType(string $type)

Parameters

string $type

at line 254
public string getSourceType()

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

git, svn

Return Value

string The repository type

at line 262
public setSourceUrl(string $url)

Parameters

string $url

at line 270
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 278
public setSourceReference(string $reference)

Parameters

string $reference

at line 286
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 294
public setDistType(string $type)

Parameters

string $type

at line 302
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 310
public setDistUrl(string $url)

Parameters

string $url

at line 318
public string getDistUrl()

Returns the url of the distribution archive of this version

Return Value

string

at line 326
public setDistReference(string $reference)

Parameters

string $reference

at line 334
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 342
public setDistSha1Checksum(string $sha1checksum)

Parameters

string $sha1checksum

at line 350
public string getDistSha1Checksum()

Returns the sha1 checksum for the distribution archive of this version

Return Value

string

at line 360
public setRepositories(string $repositories)

Set the repositories

Parameters

string $repositories

at line 368
public array getRepositories()

Returns an array of repositories

{"": {}}

Return Value

array Repositories

at line 376
public string getVersion()

Returns the version of this package

Return Value

string version

at line 384
public string getPrettyVersion()

Returns the pretty (i.e.

non-normalized) version string of this package

Return Value

string version

at line 394
public setLicense(array $license)

Set the license

Parameters

array $license

at line 402
public array getLicense()

Returns the package license, e.g.

MIT, BSD, GPL

Return Value

array The package licenses

at line 412
public setRequires(array $requires)

Set the required packages

Parameters

array $requires A set of package links

at line 420
public array getRequires()

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

Return Value

array An array of package links defining required packages

at line 430
public setConflicts(array $conflicts)

Set the conflicting packages

Parameters

array $conflicts A set of package links

at line 438
public array getConflicts()

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

Return Value

array An array of package links defining conflicting packages

at line 448
public setProvides(array $provides)

Set the provided virtual packages

Parameters

array $provides A set of package links

at line 456
public array getProvides()

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

Return Value

array An array of package links defining provided packages

at line 466
public setReplaces(array $replaces)

Set the packages this one replaces

Parameters

array $replaces A set of package links

at line 474
public array getReplaces()

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

Return Value

array An array of package links defining replaced packages

at line 484
public setDevRequires(array $devRequires)

Set the recommended packages

Parameters

array $devRequires A set of package links

at line 492
public array getDevRequires()

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

These are installed if in dev mode.

Return Value

array An array of package links defining packages required for development

at line 502
public setSuggests(array $suggests)

Set the suggested packages

Parameters

array $suggests A set of package names/comments

at line 510
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 520
public setReleaseDate(DateTime $releaseDate)

Set the releaseDate

Parameters

DateTime $releaseDate

at line 528
public DateTime getReleaseDate()

Returns the release date of the package

Return Value

DateTime

at line 538
public setKeywords(array $keywords)

Set the keywords

Parameters

array $keywords

at line 546
public array getKeywords()

Returns an array of keywords relating to the package

Return Value

array

at line 556
public setAuthors(array $authors)

Set the authors

Parameters

array $authors

at line 564
public array getAuthors()

Returns an array of authors of the package

Each item can contain name/homepage/email keys

Return Value

array

at line 574
public setDescription(string $description)

Set the description

Parameters

string $description

at line 582
public string getDescription()

Returns the package description

Return Value

string

at line 592
public setHomepage(string $homepage)

Set the homepage

Parameters

string $homepage

at line 600
public string getHomepage()

Returns the package homepage

Return Value

string

at line 610
public setMinimumStability(string $minimumStability)

Set the minimumStability

Parameters

string $minimumStability

at line 618
public getMinimumStability()

{@inheritDoc}

at line 628
public setStabilityFlags(array $stabilityFlags)

Set the stabilityFlags

Parameters

array $stabilityFlags

at line 636
public getStabilityFlags()

{@inheritDoc}

at line 646
public setReferences(array $references)

Set the references

Parameters

array $references

at line 654
public getReferences()

{@inheritDoc}

at line 664
public setAutoload(array $autoload)

Set the autoload mapping

Parameters

array $autoload Mapping of autoloading rules

at line 672
public array getAutoload()

Returns an associative array of autoloading rules

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

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

Return Value

array Mapping of autoloading rules

at line 682
public setIncludePaths(array $includePaths)

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

Parameters

array $includePaths List of directories.

at line 690
public array getIncludePaths()

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

Return Value

array

at line 700
public setSupport(array $support)

Set the support information

Parameters

array $support

at line 708
public array getSupport()

Returns the support information

Return Value

array