1
0
Fork 0

Add source/dist reference information to package

pull/29/head
Jordi Boggiano 2011-09-29 00:49:23 +02:00
parent 00a4fe2a14
commit f48634d074
3 changed files with 50 additions and 0 deletions

View File

@ -65,6 +65,7 @@ class ArrayLoader
} }
$package->setSourceType($config['source']['type']); $package->setSourceType($config['source']['type']);
$package->setSourceUrl($config['source']['url']); $package->setSourceUrl($config['source']['url']);
$package->setSourceReference($config['source']['reference']);
} }
if (isset($config['dist'])) { if (isset($config['dist'])) {
@ -79,6 +80,7 @@ class ArrayLoader
} }
$package->setDistType($config['dist']['type']); $package->setDistType($config['dist']['type']);
$package->setDistUrl($config['dist']['url']); $package->setDistUrl($config['dist']['url']);
$package->setDistReference($config['dist']['reference']);
$package->setDistSha1Checksum($config['dist']['shasum']); $package->setDistSha1Checksum($config['dist']['shasum']);
} }

View File

@ -23,8 +23,10 @@ class MemoryPackage extends BasePackage
protected $installationSource; protected $installationSource;
protected $sourceType; protected $sourceType;
protected $sourceUrl; protected $sourceUrl;
protected $sourceReference;
protected $distType; protected $distType;
protected $distUrl; protected $distUrl;
protected $distReference;
protected $distSha1Checksum; protected $distSha1Checksum;
protected $releaseType; protected $releaseType;
protected $version; protected $version;
@ -133,6 +135,22 @@ class MemoryPackage extends BasePackage
return $this->sourceUrl; return $this->sourceUrl;
} }
/**
* @param string $reference
*/
public function setSourceReference($reference)
{
$this->sourceReference = $reference;
}
/**
* {@inheritDoc}
*/
public function getSourceReference()
{
return $this->sourceReference;
}
/** /**
* @param string $type * @param string $type
*/ */
@ -165,6 +183,22 @@ class MemoryPackage extends BasePackage
return $this->distUrl; return $this->distUrl;
} }
/**
* @param string $reference
*/
public function setDistReference($reference)
{
$this->distReference = $reference;
}
/**
* {@inheritDoc}
*/
public function getDistReference()
{
return $this->distReference;
}
/** /**
* @param string $url * @param string $url
*/ */

View File

@ -110,6 +110,13 @@ interface PackageInterface
*/ */
function getSourceUrl(); function getSourceUrl();
/**
* Returns the repository reference of this package, e.g. master, 1.0.0 or a commit hash for git
*
* @return string The repository reference
*/
function getSourceReference();
/** /**
* Returns the type of the distribution archive of this version, e.g. zip, tarball * Returns the type of the distribution archive of this version, e.g. zip, tarball
* *
@ -124,6 +131,13 @@ interface PackageInterface
*/ */
function getDistUrl(); function getDistUrl();
/**
* Returns the reference of the distribution archive of this version, e.g. master, 1.0.0 or a commit hash for git
*
* @return string
*/
function getDistReference();
/** /**
* Returns the sha1 checksum for the distribution archive of this version * Returns the sha1 checksum for the distribution archive of this version
* *