\Horde_Pear_Rest

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

Summary

Methods
Properties
Constants
__construct()
setServer()
fetchPackageList()
fetchPackageInformation()
fetchPackageReleases()
fetchLatestPackageReleases()
fetchLatestRelease()
fetchReleaseInformation()
releaseExists()
fetchReleasePackageXml()
fetchPackageDependencies()
fetchChannelXml()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
_get()
_read()
$_client
$_url
$_package_states
N/A

Properties

$_client

$_client : \Horde_Http_Client

The HTTP client.

Type

\Horde_Http_Client

$_url

$_url : string

The base URL for the remote PEAR server

Type

string

$_package_states

$_package_states : array

The package states already fetched.

Type

array

Methods

__construct()

__construct(\Horde_Http_Client  $client, string  $url) 

Constructor.

Parameters

\Horde_Http_Client $client

The HTTP client.

string $url

The URL for the remote PEAR server.

setServer()

setServer(  $server) : NULL

Set the server name.

Parameters

$server

Returns

NULL

fetchPackageList()

fetchPackageList() : resource

Return the complete list of packages on the server.

Returns

resource —

A stream with the package list.

fetchPackageInformation()

fetchPackageInformation(string  $package) : resource

Return the information on a specific package from the server.

Parameters

string $package

The name of the package to retrieve information for.

Returns

resource —

A stream with the package information.

fetchPackageReleases()

fetchPackageReleases(string  $package) : resource

Return the release list for a specific package from the server.

Parameters

string $package

The name of the package to retrieve the releases for.

Returns

resource —

A stream with the package release information.

fetchLatestPackageReleases()

fetchLatestPackageReleases(string  $package) : array

Return the latest releases for a specific package.

Parameters

string $package

The name of the package to retrieve the latest releases for.

Returns

array —

A list of latest releases per level of stability.

fetchLatestRelease()

fetchLatestRelease(string  $package) : string

Return the latest release version for a specific package.

Parameters

string $package

The name of the package to retrieve the latest release for.

Returns

string —

The version of the latest release.

fetchReleaseInformation()

fetchReleaseInformation(string  $package, string  $version) : resource

Return the release information for a specific package version from the server.

Parameters

string $package

The name of the package.

string $version

The version of the release.

Returns

resource —

A stream with the package release information.

releaseExists()

releaseExists(string  $package, string  $version) : boolean

Test if the specified release exists.

Parameters

string $package

The name of the package.

string $version

The version of the release.

Returns

boolean —

True if the release exists.

fetchReleasePackageXml()

fetchReleasePackageXml(string  $package, string  $version) : resource

Return the package.xml for a specific release from the server.

Parameters

string $package

The name of the package.

string $version

The version of the release.

Returns

resource —

A stream with the package.xml information.

fetchPackageDependencies()

fetchPackageDependencies(string  $package, string  $version) : string

Return the serialized package dependencies for a specific release from the server.

Parameters

string $package

The name of the package.

string $version

The version of the release.

Returns

string —

The serialized dependencies.

fetchChannelXml()

fetchChannelXml() : string

Return the channel.xml from the server.

Returns

string —

The content of the channel.xml file.

_get()

_get(string  $url) : resource

Fetch the provided URL as stream.

Parameters

string $url

The URL.

Returns

resource —

The response as stream.

_read()

_read(string  $url) : string

Fetch the provided URL as string.

Parameters

string $url

The URL.

Returns

string —

The response as string.