PHP Programming Language - Cultural View

PHP Programming Language - Cultural View PHP Programming Language - Cultural View

culturalview.com
from culturalview.com More from this publisher
10.02.2013 Views

PEAR 166 PEAR The PHP Extension and Application Repository, or PEAR, is a repository of PHP software code. Stig S. Bakken founded the PEAR project in 1999 to promote the re-use of code that performs common functions. The project seeks to provide a structured library of code, maintain a system for distributing code and for managing code packages, and promote a standard coding style. Though community-driven, the PEAR project has a PEAR Group which serves as the governing body and takes care of administrative tasks. Each PEAR code package comprises an independent project under the PEAR umbrella. It has its own development team, versioning-control and documentation. PEAR packages A PEAR package is distributed as a gzipped tar file. Each archive consists of source code written in PHP, usually in an object-oriented style. Many PEAR packages can readily be used by developers as ordinary third party code via simple include statements in PHP. More elegantly, the PEAR package manager which comes with PHP by default may be used to install PEAR packages so that the extra functionality provided by the package appears as an integrated part of the PHP installation. Unlike the Comprehensive Perl Archive Network (CPAN) archives, which PEAR took as its model, PEAR packages do not have implicit dependencies so that a package's placement in the PEAR package tree does not relate to code dependencies. Rather, PEAR packages must explicitly declare all dependencies on other PEAR packages. The PEAR base classes contain code for simulating object-oriented destructors and consistent error-handling. Packages exist for many basic PHP functions including authentication, caching, database access, encryption, configuration, HTML, web services and XML. PEAR package manager The PEAR package manager provides an easy way to install, uninstall, or upgrade with new PEAR packages or PECL extensions. Before installing a package it can also be instructed to take care of package dependencies so all the extra needed packages are installed too. The PEAR package manager is run from the command line using the pear command. Usually it is therefore only the server administrator who can alter the installed base of PEAR and PECL extensions. On PHP installations running on Linux, the PEAR package manager is ready for usage by default, but on Windows the PEAR package manager is only available after running a batch file called go-pear.bat. PECL PECL (PHP Extension Community Library, pronounced 'pickle') is conceptually very similar to PEAR, and indeed PECL modules are installed with the PEAR Package Manager. PECL contains C extensions for compiling into PHP. As C programs , PECL extensions run more efficiently than PEAR packages. PECL includes modules for XML-parsing, access to additional databases, mail-parsing, embedding Perl or Python in PHP scripts and for compiling PHP scripts. PECL spun off from the PEAR Project in October 2003. Originally it was called the PEAR Extension Code Library, but it now operates independently of PEAR. PECL extensions are documented alongside standard extensions within the PHP Manual, so there is no special manual for PECL extensions. Also, several extensions began their development cycle in PECL and ended up in core (the distributed PHP source) and in many of these cases the PECL versions become unmaintained.

PEAR 167 External links • The PEAR Project [1] • The PEAR Manual [2] • The PECL Project [3] • A PEAR Forum (unofficial) [4] References [1] http://pear.php.net [2] http://pear.php.net/manual/en/ [3] http://pecl.php.net [4] http://www.pear-forum.org/ PHP accelerator A PHP accelerator is an extension designed to boost the performance of software applications written using the PHP programming language. Most PHP accelerators work by caching the compiled bytecode of PHP scripts to avoid the overhead of parsing and compiling source code on each request (some or all of which may never even be executed). For best performance, caching is to shared memory with direct execution from the shared memory and the minimum of memory copying at runtime. A PHP accelerator typically reduces server load and increases the speed of PHP code anywhere from 2–10 times, depending on factors such as the inherent execution time of the PHP application and the percentage of source code actually executed on a given request. While a code optimizer may even slow down overall performance when used in isolation, it can provide an additional performance boost when coupled with a code cache as the optimization effort is performed just once. See also • List of PHP accelerators External links • Benchmarking Drupal with PHP op-code caches: APC, eAccelerator and XCache (and Standard PHP) compared [1] from April 2008. • PHP on Fire: Five Opcode Caches compared [2] including a complete chart [3] featuring Zend Platform, APC, XCache, eAccelerator ionCube Encoder and Standard PHP benchmarks. Made in October 2006. • Alternative PHP Cache [4] available as a PHP extension. References [1] http://2bits.com/articles/benchmarking-drupal-with-php-op-code-caches-apc-eaccelerator-and-xcache-compared.html [2] http://itst.net/654-php-on-fire-three-opcode-caches-compared [3] http://itst.net/wp-content/uploads/2006/10/PHP%20Bytecode%20Cacher%20Review.html [4] http://php.net/manual/en/book.apc.php

PEAR 166<br />

PEAR<br />

The <strong>PHP</strong> Extension and Application Repository, or PEAR, is a repository of <strong>PHP</strong> software code. Stig S. Bakken<br />

founded the PEAR project in 1999 to promote the re-use of code that performs common functions. The project seeks<br />

to provide a structured library of code, maintain a system for distributing code and for managing code packages, and<br />

promote a standard coding style. Though community-driven, the PEAR project has a PEAR Group which serves as<br />

the governing body and takes care of administrative tasks. Each PEAR code package comprises an independent<br />

project under the PEAR umbrella. It has its own development team, versioning-control and documentation.<br />

PEAR packages<br />

A PEAR package is distributed as a gzipped tar file. Each archive consists of source code written in <strong>PHP</strong>, usually in<br />

an object-oriented style. Many PEAR packages can readily be used by developers as ordinary third party code via<br />

simple include statements in <strong>PHP</strong>. More elegantly, the PEAR package manager which comes with <strong>PHP</strong> by default<br />

may be used to install PEAR packages so that the extra functionality provided by the package appears as an<br />

integrated part of the <strong>PHP</strong> installation. Unlike the Comprehensive Perl Archive Network (CPAN) archives, which<br />

PEAR took as its model, PEAR packages do not have implicit dependencies so that a package's placement in the<br />

PEAR package tree does not relate to code dependencies. Rather, PEAR packages must explicitly declare all<br />

dependencies on other PEAR packages.<br />

The PEAR base classes contain code for simulating object-oriented destructors and consistent error-handling.<br />

Packages exist for many basic <strong>PHP</strong> functions including authentication, caching, database access, encryption,<br />

configuration, HTML, web services and XML.<br />

PEAR package manager<br />

The PEAR package manager provides an easy way to install, uninstall, or upgrade with new PEAR packages or<br />

PECL extensions. Before installing a package it can also be instructed to take care of package dependencies so all<br />

the extra needed packages are installed too.<br />

The PEAR package manager is run from the command line using the pear command. Usually it is therefore only the<br />

server administrator who can alter the installed base of PEAR and PECL extensions. On <strong>PHP</strong> installations running<br />

on Linux, the PEAR package manager is ready for usage by default, but on Windows the PEAR package manager is<br />

only available after running a batch file called go-pear.bat.<br />

PECL<br />

PECL (<strong>PHP</strong> Extension Community Library, pronounced 'pickle') is conceptually very similar to PEAR, and indeed<br />

PECL modules are installed with the PEAR Package Manager. PECL contains C extensions for compiling into <strong>PHP</strong>.<br />

As C programs , PECL extensions run more efficiently than PEAR packages. PECL includes modules for<br />

XML-parsing, access to additional databases, mail-parsing, embedding Perl or Python in <strong>PHP</strong> scripts and for<br />

compiling <strong>PHP</strong> scripts. PECL spun off from the PEAR Project in October 2003. Originally it was called the PEAR<br />

Extension Code Library, but it now operates independently of PEAR.<br />

PECL extensions are documented alongside standard extensions within the <strong>PHP</strong> Manual, so there is no special<br />

manual for PECL extensions. Also, several extensions began their development cycle in PECL and ended up in core<br />

(the distributed <strong>PHP</strong> source) and in many of these cases the PECL versions become unmaintained.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!