If you're a PHP programmer, chances are you've either run across PEAR or could get some excellent use out of it. PEAR is an acronym for PHP Extension and Application Repository. The creators and maintainers of PEAR encourage you to pronounce it just like the fruit with the same spelling. But you'll get more than fiber from PEAR, as you'll learn when you read the rest of this article.
What is PEAR?
The purpose of PEAR is to provide a structured and standard way to distribute packages of PHP code and PHP extensions. The extensions are generally distributed as part of the PHP Extension Community Library, PECL (pronounced like “pickle”) and include compiled C code. These extensions can be easily installed with the PEAR installer.
The PEAR project was started in 1999 by Stig Bakken and now features a constitution and mission statement. Active mailing lists, a #pear channel on efnet, and numerous blogs serve as support for the PEAR project. As of the writing of this article, 2618 developers have created accounts for participation in PEAR development.
Additionally, PEAR provides a set of coding standards and development practices. These are designed to allow contributors to easily contribute and collaborate without having to adjust to various coding styles. This standardization also helps the users of PEAR packages, as it ensures that they have a consistent experience when using different packages. The PCS, PEAR Coding Standards, also specify that all files include doc-blocks. This ensures that all packages produce documentation for all their capabilities, and results in a very well documented system.
PEAR is broken up into individual packages which are installed as a unit and generally provide a tightly-knit set of capabilities. Packages can be set up to depend on other packages, and the PEAR system eases these requirements by allowing you to easily discover and install these dependencies. Packages are installed with a simple command line tool, from a PEAR distribution server (or “channel”).
The PEAR project also includes the http://pear.php.net website, which hosts many packages and resources. Additionally, it’s the central hub for the community effort behind the PEAR system and many of the packages. Automatically generated documentation for most packages is also hosted on the PEAR site.