Speed PHP development with PEAR
Published: 22 Oct 2002 09:57 BST

Time-to-delivery is an important factor when determining which technology to apply toward a solution, and PHP has taken on the challenge with PHP Extension and Application Repository (PEAR). PEAR is a code library that can reduce development time by supplying prewritten classes for standard functionality.
Similar in concept to Perl's CPAN, PEAR contains functionality for a number of features, including database, mail, and error handling. By using PEAR, developers can deploy and enhance basic functions that are already written and focus on writing new functionality.
PEAR basics
PEAR was created to provide a standardised means for developers to share PHP code and to promote use of reusable code. This project is an ongoing development effort, and users may submit code for acceptance into the PEAR library, which is bundled with PHP. All PEAR packages adhere to strict coding guidelines regarding syntax and readability conventions and consist of PHP or PHP extensions written in C.
Stig Bakken founded PEAR in late 1999. His goal was to create an organised code library that would serve as a community resource for PHP developers. The project has grown over the last two years and now contains a plethora of useful, reusable code. While there are other PHP repositories, such as Zend's Code Gallery and PHP Builder's Source Code Snippet Library, PEAR provides a level of standardisation that facilitates interoperability of functions. Additionally, submissions to PEAR are scrutinised by a panel, which provides quality assurance and reliability in the code.
Useful Web sites
Available functionality
PEAR is broken into three classes: PEAR Core Components, PEAR Packages, and PECL Packages. The Core Components include the base classes of PEAR and PEAR_Error, along with database, HTTP, logging, and e-mailing functions. The PEAR Packages include functionality providing for authentication, networking, and file system features, as well as tools for working with XML and HTML templates. PECL Packages are extensions to PHP, written in C, that do not comply with the coding guidelines. Currently, all code in this class is experimental. For more information on PEAR functionality, refer to the PEAR online manual.
If you're interested in submitting code for inclusion in PEAR, you can do so by joining the PEAR developer's mailing list and requesting that your code be reviewed. To be considered, be sure to pay attention to functionality that's already included and adhere to the PEAR coding guidelines.






