Horde_Pear_Remote::getLatestDownloadUri PHP Method

getLatestDownloadUri() public method

Retrieve the download location for the latest package release.
public getLatestDownloadUri ( string $package, string $stability = 'stable' ) : string
$package string The package name.
$stability string The stability the release should have. 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 download URI for the highest release version independent of the stability.
return string The URI for downloading the release.
    public function getLatestDownloadUri($package, $stability = 'stable')
    {
        if ($latest = $this->getLatestRelease($package, $stability)) {
            return $this->_getRelease($package, $latest)->getDownloadUri();
        } else {
            throw new Horde_Pear_Exception(sprintf('No release of stability "%s" for package "%s".', $stability, $package));
        }
    }

Usage Example

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