PHP Class Horde_Pear_Rest, horde

This implements a subset of the REST methods detailed in http://pear.php.net/manual/en/core.rest.php
显示文件 Open project: horde/horde Class Usage Examples

Public Methods

Method Description
__construct ( Horde_Http_Client $client, string $url ) Constructor.
fetchChannelXml ( ) : string Return the channel.xml from the server.
fetchLatestPackageReleases ( string $package ) : array Return the latest releases for a specific package.
fetchLatestRelease ( string $package ) : string Return the latest release version for a specific package.
fetchPackageDependencies ( string $package, string $version ) : string Return the serialized package dependencies for a specific release from the server.
fetchPackageInformation ( string $package ) : resource Return the information on a specific package from the server.
fetchPackageList ( ) : resource Return the complete list of packages on the server.
fetchPackageReleases ( string $package ) : resource Return the release list for a specific package from the server.
fetchReleaseInformation ( string $package, string $version ) : resource Return the release information for a specific package version from the server.
fetchReleasePackageXml ( string $package, string $version ) : resource Return the package.xml for a specific release from the server.
releaseExists ( string $package, string $version ) : boolean Test if the specified release exists.
setServer ( $server ) : null Set the server name.

Private Methods

Method Description
_get ( string $url ) : resource Fetch the provided URL as stream.
_read ( string $url ) : string Fetch the provided URL as string.

Method Details

__construct() public method

Constructor.
public __construct ( Horde_Http_Client $client, string $url )
$client Horde_Http_Client The HTTP client.
$url string The URL for the remote PEAR server.

fetchChannelXml() public method

Return the channel.xml from the server.
public fetchChannelXml ( ) : string
return string The content of the channel.xml file.

fetchLatestPackageReleases() public method

Return the latest releases for a specific package.
public fetchLatestPackageReleases ( string $package ) : array
$package string The name of the package to retrieve the latest releases for.
return array A list of latest releases per level of stability.

fetchLatestRelease() public method

Return the latest release version for a specific package.
public fetchLatestRelease ( string $package ) : string
$package string The name of the package to retrieve the latest release for.
return string The version of the latest release.

fetchPackageDependencies() public method

Return the serialized package dependencies for a specific release from the server.
public fetchPackageDependencies ( string $package, string $version ) : string
$package string The name of the package.
$version string The version of the release.
return string The serialized dependencies.

fetchPackageInformation() public method

Return the information on a specific package from the server.
public fetchPackageInformation ( string $package ) : resource
$package string The name of the package to retrieve information for.
return resource A stream with the package information.

fetchPackageList() public method

Return the complete list of packages on the server.
public fetchPackageList ( ) : resource
return resource A stream with the package list.

fetchPackageReleases() public method

Return the release list for a specific package from the server.
public fetchPackageReleases ( string $package ) : resource
$package string The name of the package to retrieve the releases for.
return resource A stream with the package release information.

fetchReleaseInformation() public method

Return the release information for a specific package version from the server.
public fetchReleaseInformation ( string $package, string $version ) : resource
$package string The name of the package.
$version string The version of the release.
return resource A stream with the package release information.

fetchReleasePackageXml() public method

Return the package.xml for a specific release from the server.
public fetchReleasePackageXml ( string $package, string $version ) : resource
$package string The name of the package.
$version string The version of the release.
return resource A stream with the package.xml information.

releaseExists() public method

Test if the specified release exists.
public releaseExists ( string $package, string $version ) : boolean
$package string The name of the package.
$version string The version of the release.
return boolean True if the release exists.

setServer() public method

Set the server name.
public setServer ( $server ) : null
return null