2.1. Introducing PEAR

A pear isn't just a healthy snack, it's also healthy programming. Why? Because PEAR allows you to ignore large chunks of the code that you need to make your application run. You could spend hours figuring out the best and safest way to connect your application to the database. You could also spend a month creating a light bulb from raw materials — but you won't because that would be a waste of your time and energy. You're better off buying a package of light bulbs, screwing one into the socket, and getting on with more important matters, right? The same principle applies to programming. Why spend your development time inventing a database connection library when that library already exists? You can simply plug in existing code and spend your time on more important matters — such as the actual functionality of your application.

PEAR is a five-part toolkit for developing and distributing applications. The PEAR toolkit includes

  • A structured library of open source code you can reuse freely

  • A system for code distribution and package maintenance

  • A standardized coding style for PHP

  • The PHP Extension Community Library (PECL — pronounced "pickle")

  • A Web site, mailing lists, and download mirrors for the PHP/PEAR community

Before you spend the time to install and configure PEAR, take a look around and decide for yourself whether the packages, coding standards, PHP extensions, and community support are the tools that you need to speed up development of your applications. ...

Get PHP & MySQL® Web Development All-in-One Desk Reference for Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.