Synopses & Reviews
"This book, written by my colleague, Andi Gutmans, and two very prominent PHP developers, Stig Bakken and Derick Rethans, holds the key to unlocking the riches of PHP 5. It thoroughly covers all of the features of this new version, and is a must have for all PHP developers interested in exploring PHP 5's advanced features"
Zeev Suraski, Co-Designer of PHP 5 and Co-Creator of the Zend Engine
- Expert PHP 5 programming techniques, direct from PHP 5 co-creator and key developers
- Definitive coverage of the PHP object model, design patterns, XML/SOAP integration, and more
- Solid introduction and expert insights into performance tuning, PEAR, extensions, and database access
- The definitive introduction to PHP 5's advanced features!
- The definitive introduction for today's most powerful PHP 5 techniques
In this book, PHP 5's co-creator and two leading PHP developers show you how to make the most of PHP 5's industrial-strength enhancements in any projectno matter how large or complex. Their unique insights and realistic examples illuminate PHP 5's new object model, powerful design patterns, improved XML Web services support, and much more. Whether you're creating web applications, extensions, packages, or shell scriptsor migrating PHP 4 codehere are high-powered solutions you won't find anywhere else.
Review PHP's syntax and master its object-oriented capabilitiesfrom properties and methods to polymorphism, interfaces, and reflection
- Master the four most important design patterns for PHP development
- Write powerful web applications: handle input, cookies, session extension, and more
- Integrate with MySQL, SQLite, and other database engines
- Provide efficient error handling that's transparent to your users
- Leverage PHP 5's improved XML supportincluding parsing, XSLT conversions, and more
- Build XML-based web services with XML-RPC and SOAP
- Make the most of PEAR: work with the repository, use key packages, and create your own
- Upgrade PHP 4 code to PHP 5compatibility issues, techniques, and practical workarounds
- Improve script performance: tips and tools for PHP optimization
- Use PHP extensions to handle files/streams, regular expressions, dates/times, and graphics
- Create original extensions and shell scripts
If you're a software developer new to PHP, you'll leap quickly into PHP and its new object-oriented capabilities. If you're an experienced PHP programmer, you already recognize PHP's convenience and simplicity. Now, discover all of its extraordinary power!
ABOUT THE SOFTWARE
At this book's link to Zend.com, download a fully functional 90-day version of Zend Studio, today's breakthrough tool for developing, managing, and debugging PHP code.
Series Editor Bruce Perens' is an open source evangelist, developer, and consultant whose software is a major component of most commercial embedded Linux offerings. He founded or cofounded Linux Standard Base, Open Source Initiative, and Software in the Public Interest. As Debian GNU/Linux Project Leader, he was instrumental in getting the system on two U.S. space shuttle flights.
© Copyright Pearson Education. All rights reserved.
This book, written by my colleague, Andi Gutmans, and two very prominent PHP developers, Stig Bakken and Derick Rethans, holds the key to unlocking the riches of PHP 5. It thoroughly covers all of the features of this new version, and is a must have for all PHP developers interested in exploring PHP 5's advanced features.
Back CoverThe definitive introduction for today's most powerful PHP 5 techniques
In this book, PHP 5's co-creator and two leading PHPdevelopers show you how to make the most of PHP 5's industrial-strengthenhancements in any project -- no matterhow large or complex. Their unique insights and realistic examples illuminatePHP 5's new object model, powerful design patterns, improved XML Web servicessupport, and much more. Whether you're creating Web applications, extensions,packages, or shell scripts -- or migrating PHP 4 code -- here are high-poweredsolutions you won't find anywhere else.
Review PHP's syntax and master its object-oriented capabilities-- from properties and methods to polymorphism, interfaces, and reflection
Master the four most important design patterns for PHPdevelopment
Write powerful Web applications: handle input, cookies, sessionextension, and more
Integrate with MySQL, SQLite, and other database engines
Provide efficient error handling that's transparent to your users
Leverage PHP 5's improved XML support -- including parsing, XSLTconversions, and more
Build XML-based Web services with XML-RPC and SOAP
Make the most of PEAR: work with the repository, use keypackages, and create your own
Upgrade PHP 4 code to PHP 5 -- compatibility issues, techniques,and practical workarounds
Improve script performance: tips and tools for PHP optimization
Use PHP extensions to handle files/streams, regular expressions,dates/times, and graphics
Create original extensions and shell scripts
If you're a software developer new to PHP, you'll leapquickly into PHP and its new object-oriented capabilities. If you're anexperienced PHP programmer, you already recognize PHP's convenience andsimplicity. Now, discover all of its extraordinary power!About the Software
At this book's exclusive, private link to Zend.com, downloada fully functional 90-day version of Zend Studio IDE, today's breakthrough toolfor developing, managing, and debugging PHP code.
Bruce Perens' Open Source Series is a definitive series ofLinux and Open Source books by the world's leading Linux software developers.Bruce Perens is the primary author of The Open Source Definition, the formativedocument of the open source movement and the former Debian GNU/Linux Project Leader.
About the Author
ANDI GUTMANS co-created PHP 3 and all versions since. A member of the PHP core team, he is one of the world¿s most highly regarded PHP developers.
STIG SÆTHER BAKKEN, also a member of the PHP core team, created PEAR: PHP Extension and Application Repository, the framework and global distribution system for reusable PHP components. Gutmans and Bakken are members of the PHP Hall of Fame.
DERICK RETHANS is a PHP code contributor and leader of the PHP QA team.
Table of Contents
1. What Is New in PHP 5?
New Object-Oriented Model.
New Object-Oriented Features.
Other New Language Features.
General PHP Changes.
XML and Web Services.
Other New Features in PHP 5.
New Memory Manager.
Dropped Support for Windows 95.
2. PHP 5 Basic Language.
Indirect References to Variables.
Basic Data Types.
The Cast Operators.
The Silence Operator.
The One and Only Ternary Operator.
Conditional Control Structures.
Loop Control Structures.
Code Inclusion Control Structures.
Returning Values By Value.
Returning Values By Reference.
Declaring Function Parameters.
3. PHP 5 OO Language.
Declaring a Class.
The new Keyword and Constructors.
Accessing Methods and Properties Using the $this Variable.
public, protected, and private Properties.
public, protected, and private Methods.
parent:: and self::.
Inheritance of Interfaces.
Class Type Hints in Function Parameters.
4. PHP 5 Advanced OOP and Design Patterns.
Property and Method Overloading.
Overloading the Array Access Syntax.
Implementing the Delegation Pattern Using Reflection.
5. How to Write a Web Application with PHP.
Embedding into HTML.
Safe-Handling User Input.
Techniques to Make Scripts "Safe".
Working with Passwords.
Handling the Incoming Uploaded File.
One Script Serves All.
One Script per Function.
Separating Logic from Layout.
6. Databases with PHP 5.
MySQL Strengths and Weaknesses.
Buffered Versus Unbuffered Queries.
SQLite Strengths and Weaknesses.
Best Areas of Use.
Obtaining PEAR DB.
Pros and Cons of Database Abstraction.
Which Features Are Abstracted?
7. Error Handling.
Types of Errors.
The PEAR_Error Class.
Handling PEAR Errors.
PEAR Error Modes.
What Are Exceptions?
try, catch, and throw.
8. XML with PHP 5.
Creating a SimpleXML Object.
Browsing SimpleXML Objects.
Storing SimpleXML Objects.
Communicating with XML.
9. Mainstream Extensions.
Files and Streams.
Renaming and Removing Files.
Retrieving Date and Time Information.
Formatting Date and Time.
Parsing Date Formats.
Graphics Manipulation with GD.
Case 1: Bot-Proof Submission Forms.
Case 2: Bar Chart.
Multi-Byte Strings and Character Sets.
Character Set Conversions.
Extra Functions Dealing with Multi-Byte Character Sets.
10. Using PEAR.
Installing with UNIX / Linux PHP Distribution.
Installing with PHP Windows Installer.
Using the pear Command.
CLI (Command Line Interface) Installer.
11. Important PEAR Packages.
Example: Auth with Password File.
Example: Auth with DB and User Data.
Auth Security Considerations.
Auth Scalability Considerations.
Example: Login Form.
12. Building PEAR Components.
When and How to Include Files.
PEAR Example: HelloWorld.
Building the Tarball.
Reasons to Avoid Dependencies.
Including C Code.
The PEAR Release Process.
MD5 Checksum Generation.
13. Making the Move.
The Object Model.
Passing Objects to Functions.
Assigning to $this.
Automagically Creating Objects.
var and public.
Define Classes Before Usage.
Changes in Functions.
strrpos() and strripos().
Design for Performance.
PHP Design Tip #1: Beware of State.
PHP Design Tip #2: Cache!
PHP Design Tip #3: Do Not Over Design!
Testing Versus Real Traffic.
Proling with Zend Studio's Proler.
Proling with APD.
Analyzing Trace Data.
Proling with Xdebug.
Tracing Script Execution.
Using APC (Advanced PHP Cache).
Using ZPS (Zend Performance Suite).
Compiled Code Caching.
Dynamic Content Caching.
OO Versus Procedural Code.
15. An Introduction to Writing PHP Extensions.
Returning Values from PHP Functions.
Adding Custom INI Directives.
Thread-Safe Resource Manager Macros.
16. PHP Shell Scripting.
PHP CLI Shell Scripts.
How CLI Differs From CGI.
The Shell-Scripting Environment.
Parsing Command-Line Options.
A. PEAR and PECL Package Index.
Date and Time.
B. phpDocumentor Format Reference.
internal, internal (inline).
Using the phpDocumentor Tool.
C. Zend Studio Quick Start Guide.
About the Zend Studio Client Quick Start Guide.
Client Server Configuration.
Installation and Registration.
Editing a File.
Editing a File.
Working with Projects.
Advantages of Working with Projects.
How to Create a Project.
Running the Debugger.
Configure Studio Server for Remote Debugger and Proling.
Running the Proler.