Book HomePHP CookbookSearch this book

21.4. Finding Information About a Package

21.4.1. Problem

You want to gather information about a package, such a description of what it does, who maintains it, what version you have installed, and which license it's released under.

21.4.2. Solution

If the package is installed on your machine, use the PEAR package manager's info command:

% pear info Net_URL

Otherwise, use the remote-info command:

% pear remote-info SOAP

You can also view the package's home page on http://pear.php.net.

21.4.3. Discussion

The info command provides summary information about a package:

% pear info Net_URL
About Net_URL-1.0.4
=  ==  ==  ==  ==  ==  ==  ==  ==  ==
+-----------------+-----------------------------------------+
| Package         | Net_URL                                 |
| Summary         | Easy parsing of Urls                    |
| Description     | Provides easy parsing of URLs and their |
|                 | constituent parts.                      |
| Maintainers     | Richard heyes <richard@php.net> (lead)  |
| Version         | 1.0.4                                   |
| Release Date    | 2002-07-27                              |
| Release License | BSD                                     |
| Release State   | stable                                  |
| Release Notes   | License change                          |
| Last Modified   | 2002-08-23                              |
+-----------------+-----------------------------------------+

If you don't have the package installed, ask the remote server for a description:

% pear remote-info Net_URL
Package details:
=  ==  ==  ==  ==  ==  ==  ==  =
+-------------+-----------------------------------------+
| Latest      | 1.0.4                                   |
| Installed   | 1.0.4                                   |
| Package     | Net_URL                                 |
| License     | BSD                                     |
| Category    | Networking                              |
| Summary     | Easy parsing of Urls                    |
| Description | Provides easy parsing of URLs and their |
|             | constituent parts.                      |
+-------------+-----------------------------------------+

This request displays a slightly different set of information. It doesn't include the release data but does include the general PEAR category and the latest version number for the package.

The package home page provides a more complete view and also provides links to earlier releases, a change log, and browseable access to the CVS repository. You can also view package download statistics. Figure 21-1 shows a sample package information page.

Figure 21-1

Figure 21-1. Net_URL Package Information page on PEAR web site

21.4.4. See Also

Recipe 21.3 to search for packages.



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.