Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

jobs.webdeveloper.com

e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Sams Teach Yourself PHP and MySQL: PHP Extension and Application Repository (PEAR)

June 02, 2009

Learn about PEAR, a framework and distribution system for reusable PHP packages.

Excerpted from Sams Teach Yourself PHP and MySQL: Video Learning Starter Kit by Sams Publishing. ISBN-13: 978-0-672-33027-8, ISBN-10: 0-672-33027-X, Video Copyright 2009. Used with the permission of InformIt. This is excerpted from a video lesson, to actually view the sample video lesson, click here.

Introducing PEAR

PEAR is a framework and distribution system for reusable PHP packages. PEAR is made up of the following:

  • A structured library of open-source code for PHP developers
  • A system for distributing and maintaining code in packages
  • The PEAR Coding Standards (PCS)
  • The PHP Foundation Classes (PFC)
  • Online support for the PEAR community through a website and mailing list

The PEAR Code Library

PEAR brings together many different open-source projects, each of which is bundled into its own package. Each PEAR package has its own maintainers and developers, who determine the changes and release cycle for their own packages, but the package structure is consistent for all PEAR projects.

You use the PEAR installer, which is shipped with PHP, to automatically download and install a PEAR package by simply giving its name. You will learn how to use the PEAR installer later in this lesson.

Each package may have dependencies from other PEAR packages, and this is explicitly noted in the documentation, even if packages appear to be related because of their names.

A package tree structure exists within PEAR, and an underscore character (_) separates nodes in the hierarchy. For instance, the HTTP package contains various HTTP utilities, whereas HTTP_Header deals specifically with HTTP header requests.

Package Distribution and Maintenance

PEAR packages are registered in a central database at http://pear.php.net. The PEAR website provides a searchable interface to the database by package name, category, and release date.

Maintainers of PEAR packages use the PEAR website to manage their projects. A CVS server allows developers to collaborate on source code and, once a release has been agreed upon, it can be made available from this central location immediately.

PEAR Coding Standards

The PCS documents were created because many different teams are developing open-source packages that might be of use to the PHP community.

The documents in PCS outline a structured way in which code should be written in order for a package to be accepted as part of the PEAR project. The standards are quite detailed and contain mostly points of style, such as identifier naming conventions and a consistent style to use when declaring functions and classes.

This may sound a little daunting, but as your scripts become more complicated, you will realize how important it is to write readable code, and you will begin to develop a clear coding style. The PCS documentation simply formalizes a set of guidelines for writing readable PHP.

You can find the PCS documents online at http:// pear.php.net/manual/en/standards.php.

Sams Teach Yourself PHP and MySQL: PHP Extension and Application Repository (PEAR)
Finding a PEAR Package


Up to => Home / Authoring / Tutorials / PHP




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers