Channels | Custom File Roles |
Channels | |
PEAR Manual | |
A standard PEAR channel should support this list of XML-RPC functions:
logintest - a stub function
package.getDownloadURL - retrieve a URL to download a package
package.getDepDownloadURL - retrieve a URL to download a package dependency
package.info - retrieve information on a package
package.listAll - list all packages and verbose information on each package
package.listLatestReleases - list all packages and their latest release versions
package.search - search all packages for a match
Channels can also implement channel.listAll, but we recommend that this only be implemented by pear.php.net and pecl.php.net channels, as the command is utilized by the update-channels command to retrieve an official list of channels.
The logintest xml-rpc function is called by the login command, and should return a boolean TRUE
false|struct package.getDownloadURL (
struct packageinfo
, string preferred_state = stable
, (v1.1) string installed_version = false
)
an array of format:
|
if both version and state are set, the version index should be ignored.
The client-side preferred_state. This should be used to exclude releases that are too unstable.
The current installed version of the package on the client-side. This will either be a version string, or false if the package is not installed. Use this to ensure that older versions are never returned (as defined by version_compare(possible_version, installed_version, "<")).
The package.getDownloadURL function should return an array with either two or three indices.
"version" => version of the release returned
"info" => the complete package.xml contents from the release
"url" => a URL from which to download this release. If no releases exist that fit the constraints defined by preferred_state, installed_version, and the version/state indices of packageinfo, then do not return this index, and instead return the version and package.xml of the latest release.
The url entry should NOT append .tgz or .tar, but should be something like "http://pear.php.net/get/PEAR-1.4.0" instead of "http://pear.php.net/get/PEAR-1.4.0.tgz"
Note that version 1.0 of package.getDownloadURL did not have the installed_version parameter. Version 1.1 of package.getDownloadURL does - that is the only difference between the two versions.
false|struct package.getDepDownloadURL (
string xsdversion
, struct dependency
, struct parentpackage
, string preferred_state = stable
, (v1.1) string installed_version = false
)
This should be either '1.0' or '2.0', and should match the version attribute from the top-level <package version="X.0"> tag. This should be used to determine how to process the second parameter.
if the first parameter xsdversion is '1.0', this should be an array of format:
|
if xsdversion is '2.0', this should be an array of format:
|
Note that you must always verify that the channel matches your channel. If your channel server is not at pear.php.net or pecl.php.net, you must reject all xsdversion='1.0' requests, and all xsdversion='2.0' requests where the channel is not your channel.
This is information on the parent package, and is an array of format:
|
The client-side preferred_state. This should be used to exclude releases that are too unstable.
The current installed version of the dependency on the client-side. This will either be a version string, or false if the package is not installed. Use this to ensure that older versions are never returned (as defined by version_compare(possible_version, installed_version, "<")).
Like package.getDownloadURL, package.getDepDownloadURL should return an array with either two or three indices.
"version" => version of the release returned
"info" => the complete package.xml contents from the release
"url" => a URL from which to download this release. If no releases exist that fit the constraints defined by preferred_state, installed_version, and the version/state indices of packageinfo, then do not return this index, and instead return the version and package.xml of the latest release.
The url entry should NOT append .tgz or .tar, but should be something like "http://pear.php.net/get/PEAR-1.4.0" instead of "http://pear.php.net/get/PEAR-1.4.0.tgz"
Note that version 1.0 of package.getDepDownloadURL did not have the installed_version parameter. Version 1.1 of package.getDepDownloadURL does - that is the only difference between the two versions.
false|struct package.info (
string package
, string field = null
)
Package name to retrieve information about
specific field to retrieve information about. If null, this should return an array with this indices, although others could be set as well:
|
The second parameter, if set, must be one of these choices:
authors - a current list of package maintainers in format:
|
category - the category this package is in
description - the description of the latest release
license - package license of latest release
notes - release notes of the latest release
releases - an array of the format documented above, containing information on all releases
summary - summary from latest release
struct package.listAll (
bool released_only = true
, bool stable_only = true
)
If TRUE, then packages that have no releases should not be returned in the listing of available packages
If TRUE, then packages that have no stable releases should not be returned in the listing of available packages
This function should return an array of this format for all packages that match the constraints defined above:
|
struct package.listLatestReleases (
string state = ''
)
If '', then the newest release will be returned for all packages. Otherwise, it must be one of 'snapshot', 'devel', 'alpha', 'beta', or 'stable', and the function should return the newest release that is more stable than state.
If state is 'beta', then the function should return the latest release that is beta or stable. If state is 'devel', the function should return the latest release that is devel, alpha, beta, or stable, and so on.
This function should return an array of this format for all packages that have a release within the constraint defined by the "state" parameter:
|
struct package.listAll (
string fragment
, string|bool summary = false
, bool released_only = true
, bool stable_only = true
)
A text fragment to use when searching for packages by name
If set to false, this should be ignored. Otherwise, this should be used to search through the summaries of packages that match the first parameter to limit the list of returned packages.
If TRUE, then packages that have no releases should not be returned in the listing of available packages
If TRUE, then packages that have no stable releases should not be returned in the listing of available packages
This function should return an array of this format for all packages that match the constraints defined above:
|
Channels | Custom File Roles |
Channels | |
PEAR Manual | |