Add extra and type info to packages
parent
4dbb73daba
commit
ba9f12a517
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
|
|
@ -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']);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue