518Part IIIAdvanced Features and TechniquesThe PEAR project began (Web hosting provider)

518Part IIIAdvanced Features and TechniquesThe PEAR project began in 1999, shortly after PHP itself came into being. It s a community- driven initiative dedicated to generating open-source code that improves PHP. PEAR packagesare built on top of the standard PHP functions, and are often written in an Object-Orientedstyle (for example, classes). You include these modules from your own PHP script with aninclude()or require()statement, as you would any other PHP function library or class. For the most part, PEAR is to PHP as the Comprehensive Perl Archive Network (CPAN) is toPerl. It has many parts, but the best-known and most frequently used is a library of open- source PHP code modules that may be accessed in an automated way. The PEAR modulemanagement system makes it easy for you to keep a server s PHP installation up-to-date andoutfitted with the elements it needs to do its job (for example, with the PEAR DB classes forstandardized database access and the PEAR LDAP classes for accessing a corporate direc- tory). You can run the package manager as an automated routine that checks for updated versions of your installed packages every week, if you like. Other parts of the PEAR project include: .A set of coding standards that specifically applies to PHP modules distributed by PEAR. .The PHP Foundation Classes (PFC), which are a few especially worthy PEAR classesdistributed with the main PHP package. .Various code archives and mailing lists for the people doing PEAR module develop- ment work. The PHP Extension Community Library (PECL) is a collection of PHP extensions (written in Cas all PHP extensions are) which are relatively rarely used and therefore do not need to bepart of the core PHP distribution (which was threatening to become too large and unwieldy). PECL used to be part of PEAR, but has been split off for separate management. PECL andPEAR share the same automated distribution tool, though, and so remain related projects. The key difference between PEAR modules and PECL modules: PEAR modules are written inPHP, and may be included in PHP programs as required. PECL modules are written in C, andmay be incorporated into the PHP engine itself by the normal process of recompiling. The PEAR Package SystemThe PEAR package system is an archive of compressed files (tar files compressed with gzip), each of which contains a series of PHP files and a manifest file in XML format. Each archive, when incorporated into a PHP installation on a server (by means of the automated package- management system that s discussed later in this chapter), adds to the overall collection offunctions and classes a developer can invoke in his or her code. Widely used packages handledatabase abstraction, the interpretation of various file formats, the implementation of indus- try-specific algorithms, and all kinds of convenience functions. The universe of PEAR pack- ages is large and expanding, and because the packages are of such high quality you shouldmake use of them in your own code if you can. The PEAR homepage is http://pear.php.net. A sampling of PEAR packagesHere s a much-abridged list of PEAR packages. The package name generally describes itsfunction:
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision make web site services

Leave a Reply