| Views: 335 | Posted On: Apr 27, 2009 |
PEAR contains two types of pre-written code: PECL code, and PHP code. PECL code, as mentioned already, forms 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. Most of PEAR, however, is PHP code that performs all varieties of tasks for you, with the primary advantage being that you can use PEAR code on any PHP server without needing to enable any extensions or re-compile PHP.
The most famous package in PEAR is called PEAR::DB, and provides an object-oriented, database-independent framework for reading and writing to your database. PEAR::DB is covered in depth later on.
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 directory to where PHP is, e.g. c:php.
Once you have PEAR installed on your system, you will see the "pear" command – this allows you to search for and download new PEAR modules for your PHP installation.






