In this second part of a four-part series on the MVC paradigm and the Zend framework, you'll learn what the framework can help you accomplish and how to install it. This article is excerpted from the chapter 25 of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).
The Zend Framework, an open source project fostered by the prominent PHP product and services provider Zend Technologies ( http://www.zend.com/) was at the time of this writing the most aggressively developed of the four frameworks. Additionally, the Zend Framework provides a variety of task-specific components capable of carrying out tasks that are becoming increasingly commonplace in today's cutting-edge Web applications. In addition to facilitating MVC-driven development, the Zend Framework can automate CRUD (create, retrieve, update, delete) database operations, and perform data caching and filter input. But what makes the Zend Framework particularly intriguing is the assortment of components it offers for performing nonessential but increasingly commonplace tasks such as creating PDF's, interacting with the Amazon, Flickr, and Yahoo! APIs, and consuming RSS feeds.
The rest of this chapter is focused on a fast-paced introduction to the Zend Framework's key features, serving to acquaint you with its usage as well as to excite you about the amazing boost in productivity it and similar frameworks have to offer.
Introducing the Zend Framework
Although all of the frameworks presented in the previous section are very powerful and worthy of further consideration, Zend's particularly unique approach to framework development led to the decision to explore it further in this chapter. To begin, Table 25-1 summarizes the components available by way of the framework, which should give you a pretty good idea of its diverse set of capabilities. This is followed by an overview of the installation process, and finally two examples. The first example is intended to show you just how easy it is to construct a Web site skeleton using the framework, while the second offers a somewhat more practical twist, using the Yahoo! Web Services component to facilitate sales research.
To begin, take a moment to review Table 25-1, which presents a partial list of the most interesting Zend Framework components accompanied by a brief description. In the two examples found later in this section, you'll learn how to deploy several of these components.
Table 25-1. A Partial Listing of Zend's Feature-Specific Components
Component
Purpose
Zend_Amazon
Facilitates interaction with Amazon E-Commerce Service.
Zend_Cache
Caches data into speedy backend adapters such as RAM, SQLite, and APC (Alternative PHP Cache).
Zend_Config
Facilitates the management of application configuration parameters.
Zend_Controller
Manages the framework’s controller component.
Table 25-1. A Partial Listing of Zend's Feature-Specific Components (Continued)
Component
Purpose
Zend_Db
Drives the framework’s PDO-based database API abstraction layer.
Zend_Feed
Consumes RSS and Atom feeds.
Zend_Filter
Facilitates the filtering and validation of data, including the ability to validate proper syntax for commonplace values such as e-mail addresses, credit card numbers, dates (according to ISO 8601 format), and phone numbers.
Zend_Filter_Input
Relies upon the methods provided by Zend_Filterto filter input.
Zend_Gdata
Provides an interface to several of Google’s services, including, among
others, Google Blogger, Google Calendar, and Google Notebook.
Zend_HTTP_Client
Performs HTTP requests. Presently capable of executing GET, POST, PUT, and DELETE requests.
Zend_Json
Facilitates interaction between JavaScript and PHP by serializing PHP data to JSON (JavaScript Object Notation) and vice versa. See http://www.json.org/ for more information about JSON.
Zend_Log
Facilitates application logging.
Zend_Mail
Sends text and MIME-compliant e-mail.
Zend_Mime
Parses MIME messages.
Zend_Pdf
Creates PDF documents.
Zend_Search_Lucene
Facilitates search engine development using the Lucene library.
Zend_Service_Amazon
Facilitates interaction with the Amazon Web Services API.
Zend_Service_Flickr
Facilitates interaction with the Flickr Web Services API.
Zend_Service_Yahoo
Facilitates interaction with the Yahoo! Web Services API.
Zend_View
Manages the framework’s view component.
Zend_XmlRpc
Provides support for consuming and serving XML-RPC implementations.