Horde_Pear_Remote::getLatestRelease PHP Method

getLatestRelease() public method

Return the latest release for a specific package and stability.
public getLatestRelease ( string $package, string $stability = 'stable' ) : string | boolean
$package string The name of the package.
$stability string The stability of the release. Must be one of "stable", "beta", "alpha", or "devel". The default is "stable" If you explicitely set the $stability parameter to NULL the method will return the highest release version independent of the stability.
return string | boolean The latest version for this stability or false if no version with this stability level exists.
    public function getLatestRelease($package, $stability = 'stable')
    {
        if ($stability === null) {
            return $this->_rest->fetchLatestRelease($package);
        } else {
            $result = $this->_rest->fetchLatestPackageReleases($package);
            return isset($result[$stability]) ? $result[$stability] : false;
        }
    }

Usage Example

コード例 #1
0
ファイル: Remote.php プロジェクト: jubinpatel/horde
 /**
  * Return the version of the component.
  *
  * @return string The component version.
  */
 public function getVersion()
 {
     if (!isset($this->_version)) {
         $this->_version = $this->_remote->getLatestRelease($this->_name, $this->_stability);
     }
     return $this->_version;
 }
All Usage Examples Of Horde_Pear_Remote::getLatestRelease