getReleases() public method

Returns all release for a specific package.
public getReleases ( string $package ) : Horde_Pear_Rest_Releases
$package string The name of the package.
return Horde_Pear_Rest_Releases A list of releases.
コード例 #1
0
ファイル: Remote.php プロジェクト: horde/horde
 /**
  * Returns the previous version of the component.
  *
  * @return string The previous component version.
  */
 public function getPreviousVersion()
 {
     $previousVersion = null;
     $currentVersion = $this->getVersion();
     $currentState = $this->getState();
     $releases = $this->_remote->getReleases();
     $versions = $releases->listReleases();
     usort($versions, 'version_compare');
     foreach ($versions as $version) {
         // If this is a stable version we want the previous stable version,
         // otherwise use any previous version.
         if ($currentState == 'stable' && $releases->getReleaseStability($version) != 'stable') {
             continue;
         }
         if (version_compare($version, $currentVersion, '>=')) {
             return $previousVersion;
         }
         $previousVersion = $version;
     }
     return $previousVersion;
 }