1
0
Fork 0

Enhanced PackageInterface and BasePackage with getUniqueName() method, which provides name-version-releaseType string (used in installer registry)

pull/19/head
everzet 2011-09-24 02:11:32 +03:00
parent cde9531e4d
commit 69f1de9986
2 changed files with 18 additions and 1 deletions

View File

@ -134,6 +134,16 @@ abstract class BasePackage implements PackageInterface
$this->repository = $repository; $this->repository = $repository;
} }
/**
* Returns package unique name, constructed from name, version and release type.
*
* @return string
*/
public function getUniqueName()
{
return $this->getName().'-'.$this->getVersion().'-'.$this->getReleaseType();
}
/** /**
* Converts the package into a readable and unique string * Converts the package into a readable and unique string
* *
@ -141,6 +151,6 @@ abstract class BasePackage implements PackageInterface
*/ */
public function __toString() public function __toString()
{ {
return $this->getName().'-'.$this->getVersion().'-'.$this->getReleaseType(); return $this->getUniqueName();
} }
} }

View File

@ -200,6 +200,13 @@ interface PackageInterface
*/ */
function getRepository(); function getRepository();
/**
* Returns package unique name, constructed from name, version and release type.
*
* @return string
*/
function getUniqueName();
/** /**
* Converts the package into a readable and unique string * Converts the package into a readable and unique string
* *