Horde_Pear_Rest
in package
REST access to a PEAR server.
This implements a subset of the REST methods detailed in http://pear.php.net/manual/en/core.rest.php
Tags
Table of Contents
- $_client : Horde_Http_Client
- The HTTP client.
- $_package_states : array<string|int, mixed>
- The package states already fetched.
- $_url : string
- The base URL for the remote PEAR server
- __construct() : mixed
- Constructor.
- fetchChannelXml() : string
- Return the channel.xml from the server.
- fetchLatestPackageReleases() : array<string|int, mixed>
- Return the latest releases for a specific package.
- fetchLatestRelease() : string
- Return the latest release version for a specific package.
- fetchPackageDependencies() : string
- Return the serialized package dependencies for a specific release from the server.
- fetchPackageInformation() : resource
- Return the information on a specific package from the server.
- fetchPackageList() : resource
- Return the complete list of packages on the server.
- fetchPackageReleases() : resource
- Return the release list for a specific package from the server.
- fetchReleaseInformation() : resource
- Return the release information for a specific package version from the server.
- fetchReleasePackageXml() : resource
- Return the package.xml for a specific release from the server.
- releaseExists() : bool
- Test if the specified release exists.
- setServer() : null
- Set the server name.
- _get() : resource
- Fetch the provided URL as stream.
- _read() : string
- Fetch the provided URL as string.
Properties
$_client
The HTTP client.
private
Horde_Http_Client
$_client
$_package_states
The package states already fetched.
private
array<string|int, mixed>
$_package_states
$_url
The base URL for the remote PEAR server
private
string
$_url
Methods
__construct()
Constructor.
public
__construct(Horde_Http_Client $client, string $url) : mixed
Parameters
- $client : Horde_Http_Client
-
The HTTP client.
- $url : string
-
The URL for the remote PEAR server.
Return values
mixed —fetchChannelXml()
Return the channel.xml from the server.
public
fetchChannelXml() : string
Return values
string —The content of the channel.xml file.
fetchLatestPackageReleases()
Return the latest releases for a specific package.
public
fetchLatestPackageReleases(string $package) : array<string|int, mixed>
Parameters
- $package : string
-
The name of the package to retrieve the latest releases for.
Return values
array<string|int, mixed> —A list of latest releases per level of stability.
fetchLatestRelease()
Return the latest release version for a specific package.
public
fetchLatestRelease(string $package) : string
Parameters
- $package : string
-
The name of the package to retrieve the latest release for.
Return values
string —The version of the latest release.
fetchPackageDependencies()
Return the serialized package dependencies for a specific release from the server.
public
fetchPackageDependencies(string $package, string $version) : string
Parameters
- $package : string
-
The name of the package.
- $version : string
-
The version of the release.
Return values
string —The serialized dependencies.
fetchPackageInformation()
Return the information on a specific package from the server.
public
fetchPackageInformation(string $package) : resource
Parameters
- $package : string
-
The name of the package to retrieve information for.
Return values
resource —A stream with the package information.
fetchPackageList()
Return the complete list of packages on the server.
public
fetchPackageList() : resource
Return values
resource —A stream with the package list.
fetchPackageReleases()
Return the release list for a specific package from the server.
public
fetchPackageReleases(string $package) : resource
Parameters
- $package : string
-
The name of the package to retrieve the releases for.
Return values
resource —A stream with the package release information.
fetchReleaseInformation()
Return the release information for a specific package version from the server.
public
fetchReleaseInformation(string $package, string $version) : resource
Parameters
- $package : string
-
The name of the package.
- $version : string
-
The version of the release.
Return values
resource —A stream with the package release information.
fetchReleasePackageXml()
Return the package.xml for a specific release from the server.
public
fetchReleasePackageXml(string $package, string $version) : resource
Parameters
- $package : string
-
The name of the package.
- $version : string
-
The version of the release.
Return values
resource —A stream with the package.xml information.
releaseExists()
Test if the specified release exists.
public
releaseExists(string $package, string $version) : bool
Parameters
- $package : string
-
The name of the package.
- $version : string
-
The version of the release.
Return values
bool —True if the release exists.
setServer()
Set the server name.
public
setServer(mixed $server) : null
Parameters
- $server : mixed
Tags
Return values
null —_get()
Fetch the provided URL as stream.
private
_get(string $url) : resource
Parameters
- $url : string
-
The URL.
Return values
resource —The response as stream.
_read()
Fetch the provided URL as string.
private
_read(string $url) : string
Parameters
- $url : string
-
The URL.
Return values
string —The response as string.