Abstract Package Name (for install/uninstall command)
Вернуться к: Basic concepts all PEAR users should understand
There are several different ways of referring to a package that Pyrus and the PEAR Installer understand. Three ways are concrete, in that they refer to deterministic entities such as a package.xml file on disk, or a URI (Uniform Resource Identifier) such as http://pear.php.ne/get/PEAR-1.8.1.tgz that refers to a file on a remote server.
Package type | Local/Remote | Example |
---|---|---|
package.xml file | Local | php pyrus.phar install /path/to/package.xml |
Package release archive | Local | php pyrus.phar install /path/to/PackageName-1.2.3.tgz |
Static url | Remote | php pyrus.phar install http://example.com/PackageName-1.2.3.tgz |
Abstract package | Remote | php pyrus.phar install PackageName |
The first three ways of specifying a package are concrete: the package name always refers to one and only one package. Abstract packages are more flexible, and there are several ways of requesting a package. Note that if the channel is not explicitly requested (as it is in the last example), Pyrus or the PEAR Installer prepends the default channel. The default channel is set by the default_channel configuration variable, and is set to one of pear.php.net (pear command), pecl.php.net (pecl command), or pear2.php.net (Pyrus) unless explicitly changed by a call to the config-set (pear/pecl command) or set (pyrus) command. A request for PackageName will be interpreted by the PEAR Installer or Pyrus to be a request for package PackageName from the default channel, as if the user had requested pear.php.net/PackageName (pear command), pecl.php.net/PackageName (pecl command) or pear2.php.net/PackageName (pyrus).
Example | Description |
---|---|
PackageName-1.2.3 | This forces Pyrus to download version 1.2.3 of package PackageName, but will will attempt to download a release in one of the following file formats, in this order:
|
PackageName-alpha | This causes Pyrus to download the latest version of package PackageName that is alpha stability or better (the hierarchy of stabilities is devel, alpha, beta, stable). After finding a matching version, it will attempt to download a release in one of the following file formats, in this order:
|
PackageName | This causes Pyrus to download the latest version of package PackageName that is preferred_state (configuration variable) stability or better (the hierarchy of stabilities is devel, alpha, beta, stable). After finding a matching version, it will attempt to download a release in one of the following file formats, in this order:
|
PackageName#groupname | This causes Pyrus to download and install a release of Pyrus as specified above, and it also causes Pyrus to download and install the contents of the groupname dependency group (dependency groups are documented here). Note that PackageName in PackageName#groupname can be any of the above examples, such as PackageName-1.2.3#groupname. |
channelname/PackageName | This causes Pyrus to download and install a release of PackageName from the channel channelname. Another syntax that can be used is channel://channelname/PackageName which is useful if there is a sub-directory of the current working directory named channelname and a file or directory within it named PackageName. Note that in the example above, PackageName can be any of the previous syntaces such as channelname/PackageName-1.2.3#groupname. |
Abstract Package for installed packages
Note that the uninstall, run-scripts, and other commands that operate on installed packages only support a simple package name as in PackageName or channelname/PackageName. Any fancy stuff like pear2.php.net/PackageName-1.2.3#group is ignored.
Вернуться к: Basic concepts all PEAR users should understand