diff --git a/src/Composer/Package/MemoryPackage.php b/src/Composer/Package/MemoryPackage.php index 814d6d71d..0476f86e6 100644 --- a/src/Composer/Package/MemoryPackage.php +++ b/src/Composer/Package/MemoryPackage.php @@ -28,6 +28,7 @@ class MemoryPackage extends BasePackage protected $releaseType; protected $version; protected $license; + protected $extra = array(); protected $requires = array(); protected $conflicts = array(); @@ -67,6 +68,22 @@ class MemoryPackage extends BasePackage return $this->type ?: 'library'; } + /** + * @param array $extra + */ + public function setExtra(array $extra) + { + $this->extra = $extra; + } + + /** + * {@inheritDoc} + */ + public function getExtra() + { + return $this->extra; + } + /** * @param string $type */ diff --git a/src/Composer/Package/PackageInterface.php b/src/Composer/Package/PackageInterface.php index 2ce324da9..3a8eceb84 100644 --- a/src/Composer/Package/PackageInterface.php +++ b/src/Composer/Package/PackageInterface.php @@ -38,17 +38,17 @@ interface PackageInterface function getNames(); /** - * Allows the solver to set an id for this package to refer to it. - * - * @param int $id - */ + * Allows the solver to set an id for this package to refer to it. + * + * @param int $id + */ function setId($id); /** - * Retrieves the package's id set through setId - * - * @return int The previously set package id - */ + * Retrieves the package's id set through setId + * + * @return int The previously set package id + */ function getId(); /** @@ -68,6 +68,13 @@ interface PackageInterface */ function getType(); + /** + * Returns the package extra data + * + * @return array The package extra data + */ + function getExtra(); + /** * Returns the repository type of this package, e.g. git, svn * diff --git a/src/Composer/Repository/ComposerRepository.php b/src/Composer/Repository/ComposerRepository.php index 9eea15f0b..eddd2b3a3 100644 --- a/src/Composer/Repository/ComposerRepository.php +++ b/src/Composer/Repository/ComposerRepository.php @@ -55,6 +55,14 @@ class ComposerRepository extends ArrayRepository $package->setDistUrl($rev['dist']['url']); $package->setDistSha1Checksum($rev['dist']['shasum']); + if (isset($rev['type'])) { + $package->setType($rev['type']); + } + + if (isset($rev['extra'])) { + $package->setExtra($rev['extra']); + } + if (isset($rev['license'])) { $package->setLicense($rev['license']); }