O'Reilly logo

Professional PHP Design Patterns by Aaron Saray

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

2.1. Patterns in Existing Frameworks

Some of the things that make the most common PHP frameworks so successful are their careful architecture, maintainability, and extensibility. This is all a tribute to the proper use of Design Patterns in their initial architecture. This section pulls out a couple of examples of the use of these patterns for each framework. The goal is to demonstrate even more the proliferation of these patterns throughout your daily programming so that the reference chapters seem less daunting. If you see an example of a Design Pattern being featured in one of these frameworks, feel free to page ahead to that reference chapter to learn more about it.

It is important to reiterate that a Design Pattern is simply a template for constructing your program. Not every Design Pattern-based architecture will be one object to a pattern, nor will it follow the exact book specifications of that pattern. You will very often find classes created with more than one Design Pattern or that the base pattern has been heavily tweaked to fit into the particular context.

2.1.1. Design Patterns in PEAR

PEAR is one of the oldest libraries of PHP extensions. PEAR stands for PHP Extension of Application Repository. The PEAR website's quick summary of PEAR almost screams the potential for being a great example for Design Patterns, specifically this phrasing: "for reusable PHP components." While the newest versions of PHP are no longer bundling PEAR into the core distribution, I'm sure ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required