Book Image

PHP Programming with PEAR

By : Carsten Lucke, Stoyan Stefanov
Book Image

PHP Programming with PEAR

By: Carsten Lucke, Stoyan Stefanov

Overview of this book

<p>PEAR is the PHP Extension and Application Repository, and is a framework and distribution system for reusable, high-quality PHP components, available in the form of "packages". <br /><br />In this book, you will learn how to use a number of the most powerful PEAR packages available to boost your PHP development productivity. By focusing on these packages for key development activities, this book is an in-depth guide to getting the most from these powerful coding resources.<br /><br />You will become a master of various PEAR packages that help you with the essential tasks of PHP development such as:<br /><br />•&nbsp;&nbsp;&nbsp; Accessing databases with MDB2<br />•&nbsp;&nbsp;&nbsp; Displaying data in a range of formats (HTML, Excel spreadsheet, PDF)<br />•&nbsp;&nbsp;&nbsp; Creating and parsing XML documents<br />•&nbsp;&nbsp;&nbsp; Serializing PHP objects into XML, and unserializing XML documents to PHP objects<br />•&nbsp;&nbsp;&nbsp; Consuming and offering web services<br />•&nbsp;&nbsp;&nbsp; Accessing Web APIs including Google, Yahoo, Amazon, and Technorati</p>
Table of Contents (10 chapters)

Summary


In this chapter, we have learned how to use several PEAR packages that can be used when working with XML. XML_Util, XML_FastCreate, and XML_Serializer can be used to easily create generic XML documents without having to worry about the rules of well-formed XML documents or tag indentation. XML_XUL allows us to create applications for Mozilla-based browsers like Firefox using PHP. This allows us to share the business logic with standard web applications but exchange the front end of our applications with an XUL-based interface.

In the second half of the chapter we have learned how to build a SAX-based parser to read an XML-based configuration file and automatically ignore the parts of the XML document that are not important to us. We have used XML_Unserializer to create arrays and objects from virtually any XML document. This allows us easy access to information stored in an XML document without needing to know anything about the parsing process itself. Last, we used the XML_RSS package...