Enhanced PackageInterface and BasePackage with getUniqueName() method, which provides name-version-releaseType string (used in installer registry)
parent
cde9531e4d
commit
69f1de9986
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue