Section 3.3. PEAR


3.3. PEAR

The PHP Extension and Application Repository, or PEAR for short, contains re-usable code written by others that enables you to create powerful scripts using just a few simple commands.

PEAR contains two types of pre-written code: PECL code and PHP code . PECL code, as mentioned already, are full extensions written in C that interact with external libraries. Extensions reside in PECL when they are considered useful, but not popular or much used. However, most of PEAR is PHP code, which means you can use it on any PHP server without enabling any extensions or recompiling PHP.

The most famous package in PEAR is called PEAR::DB, and provides an object-oriented, database-independent framework for reading from and writing to your database. PEAR::DB is covered in depth in Chapter 14.

PHP comes with "go-pear," an easy way to configure PEAR for use on your computer. To use it, simply run go-pear from the command line and follow the on-screen instructions. Windows users will need to change to the directory where PHP is, e.g., c:\php.

The output of go-pear is shown in Figure 3-1.

Once you have PEAR installed on your system, you will see the pear commandthis allows you to search for and download new PEAR modules for your PHP installation.

Figure 3-1. Running go-pear will set up PEAR on your computer




PHP in a Nutshell
Ubuntu Unleashed
ISBN: 596100671
EAN: 2147483647
Year: 2003
Pages: 249

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net