PHP Foundation Classes
PFC is a subset of PEAR packages, and these classes have
a strict set of entrance criteria:
- Quality—Packages must be in a stable state.
- Generality—Packages should not be excessively
specific to any particular type of environment.
- Interoperability—Packages should work well with
other packages and in different environments, and they
should have a standardized API.
- Compatibility—Packages must be designed to be
backward compatible when new features are added.
At the present time, only the PEAR installer is shipped
with PHP. However, at a later date, certain classes may be
included as standard. The PFC would be those classes.
Online Support for PEAR
The PEAR website, at http://pear.php.net, includes
comprehensive online documentation for the PEAR project. The
package database can be searched via the website, and
package maintainers can log in to update their project
details.
There are a number of mailing lists for PEAR users,
maintainers, core developers, and webmasters. You can join
any or all of these lists by using the form at http://pear
.php.net/support/lists.php.
Using PEAR
In the following sections you will learn how to use PEAR
to find and install packages on a system, and you’ll learn
how to submit your own projects for consideration as PEAR
packages.
Finding a PEAR Package
On every page of the PEAR website is a search box that
you can use to search the package database. You simply enter
a name, or part of a name, and all matching packages are
displayed.
Searching Packages - To perform a detailed
search on a package name, maintainer, or release date, you
can use the form at http://pear.php.net/package-search.php.
You can click the name of the package you are interested
in from the search results. The page that is then displayed
should give some key information about that package,
including a summary of its features, the current release
version, and status and information about its
dependencies—that is, any other PEAR packages that are
required for this package to work.
The tabs at the top of the package details page allow you
to view the documentation. If you are unsure from the
summary information about exactly what you can achieve by
using a particular package, you can browse through the
documentation pages.
If you simply want to browse all the available PEAR
packages, you can go to the categorized list at http://pear.php.net/
packages.php.
Using the PEAR Installer
When you have decided that a package will be useful, you
can download it from the web by using the tab at the top of
its package information page. However, using the PEAR
installer program is a quick and easy way to manage packages
within a PHP installation. The installer is able to find and
download the latest version of a package and can also
install it for you automatically.
The PEAR installer is named pear. To run the installer,
you run the pear command followed by a command option. To
see all the packages currently installed on a system, you
can use the list command option:
$ pear list
Command Option - Running pear with no arguments brings
up a list of all the available command options.
The output produced should be similar to the
following:
Installed packages:
===================
Package Version State
DB 1.6.2 stable
HTTP 1.2.2 stable
Net_DNS 1.00b2 beta
Net_SMTP 1.2.6 stable
Net_Socket 1.0.1 stable
PEAR 1.3.2 stable
SQLite 1.0.2 stable
Each package name, the version installed, and its release
status are shown. The actual packages installed on your
system may differ from the ones shown here.
Sams Teach Yourself PHP and MySQL: PHP Extension and Application Repository (PEAR)
Sams Teach Yourself PHP and MySQL: PHP Extension and Application Repository (PEAR)
PHP Foundation Classes - Cont.
|