| Php - Using the PEAR Package Manager |
| Article Index |
|---|
| Php - Using the PEAR Package Manager |
| Page 2 |
| Page 3 |
| Page 4 |
The PEAR Package Manager is not a necessary part of PEAR, but it is an important one, and it's part of what defines PEAR, as shown earlier. It streamlines the process of downloading packages from PEAR and checks for package dependencies. It places the package files in their correct locations and even helps developers make packages of their own for use in PEAR.
For the most part, the developer functionality of the PPM is not necessary for the average user of PEAR classes, so those commands and options are omitted from the following descriptions. What follows are basic commands for managing a local installation of PEAR, from listing packages to installing and removing them.
Listing Packages
To see what PEAR packages are installed, enter the following at a command prompt (assuming pear is in the PATH):
pear list
This command outputs a listing that looks similar to this:
Installed packages:
===================
Package Version State
Archive_Tar 1.1 stable
Console_Getopt 1.2 stable
PEAR 1.3.3.1 stable
XML_RPC 1.1.0 stable
If no other packages have been installed other than those included by default, the packages in the listing will be those considered current PFC packages. Another similar listing is provided by the pear list-all command, which shows all packages in PEAR and notes the current version number of those packages installed on the local system. If it's not installed, no version number is listed in the "Local" column.
Finding Packages
There are many packages in the repository, and many more in the proposal stages. Although the initial PEAR installation starts out with a small set of packages, chances are that you'll need other packages. The PPM has a useful tool for searching by package name, aptly named search.
Although a search by package name may be performed at , the PPM provides the same functionality. For example, consider a Web-based application that requires some form of page-caching mechanism. Rather than build such a mechanism from scratch, first check the PEAR repository for a cache package by entering the following at a command prompt:
pear search cache
| Users' Comments (0) |
|
No comment posted








