You are previewing Object-Oriented PHP.
O'Reilly logo
Object-Oriented PHP

Book Description

Object-Oriented PHP shows developers how to take advantage of the new object-oriented features of PHP. Working within the context of concrete examples, the book begins with code compatible with PHP 4 and 5, and then focuses on object-orientation in PHP 5. The author's practical approach uses numerous code examples, which will help developers get up to speed with object oriented PHP quickly, and show them how to apply what they learn to everyday situations. All code samples are available for download on the book's companion site.

Table of Contents

  1. OBJECT-ORIENTED PHP.
  2. ACKNOWLEDGMENTS
  3. INTRODUCTION
    1. What Does This Book Have to Offer?
    2. Who Should Read This Book?
    3. Requirements
    4. Overview of Contents
    5. Companion Website
    6. Resources
  4. WHAT A TANGLED WEB WE WEAVE
    1. Do We Really Need Objects?
    2. The PHP Culture
  5. BASICS OF OBJECT-ORIENTED PROGRAMMING
    1. Class
    2. Objects Need Access Modifiers
    3. Object Reuse and Inheritance
    4. Where to Go from Here
  6. OBJECT-ORIENTED FEATURES NEW TO PHP 5
    1. Access Modifiers
    2. Built-in Classes
    3. Backward Compatibility
    4. Where to Go from Here
  7. SHOW A LITTLE CLASS
    1. Design
    2. Not the Da Vinci Code
    3. Creating an Instance
    4. What Have You Accomplished?
    5. But Will It Fly?
  8. MOD UR CLASS
    1. Upgrading to PHP 5
    2. Modifying Your Class
    3. Summary of Changes
  9. THE THUMBNAILIMAGE CLASS
    1. What Does a Designer Do?
    2. The ThumbnailImage Class
    3. Displaying a Thumbnail
    4. Putting It All Together
    5. Where to Go from Here
  10. BUILDING THE PAGENAVIGATOR CLASS
    1. How Will the Navigator Behave
    2. What Will It Look Like?
    3. The Code
    4. The getNavigator Method
    5. Where to Go from Here
  11. USING THE PAGENAVIGATOR CLASS
    1. DirectoryItems Change
    2. CSS and Reusability
    3. Paging with Class
    4. Where to Go from Here
  12. DATABASE CLASSES
    1. Using What You Know
    2. One Lump or Two?
    3. The MySQLConnect Class
    4. The MySQLResultSet Class
    5. Using the Page Navigator
    6. Where to Go After the Navigator
  13. IMPROVEMENT THROUGH INHERITANCE
    1. The Standard PHP Library
    2. Extending a Class Through Inheritance
    3. Replacing Errors with Exceptions
    4. The MySQLException Class
    5. Changes to the MySQLConnect Class
    6. Catching Exceptions
    7. Implementing an Interface
    8. Where to Go from Here
  14. ADVANCED OBJECT-ORIENTED PROGRAMMING CONCEPTS
    1. Abstract Classes
    2. Polymorphism
    3. Static Classes
    4. Design Patterns
    5. Where to Go from Here
  15. Keeping It Fresh
    1. SimpleXML
    2. Site-Specific Search
    3. Complex Tasks Made Easy
    4. Would You Want to Do It Procedurally?
  16. MORE MAGIC METHODS
    1. __get and __set
    2. __isset and __unset
    3. __call
    4. __autoload
    5. __sleep and __wakeup
    6. __clone
    7. A Note About Overloading
  17. Creating Documentation Using the Reflection Classes
    1. What Are the Reflection Classes?
    2. The Reflection Group of Classes
    3. What Format Do You Want?
    4. The Documenter Class
    5. Using the Documenter Class
    6. Reflecting
  18. EXTENDING SQLITE
    1. Brief Overview
    2. Directory Structure
    3. How It's Done
    4. Getting Started
    5. Creating a Table
    6. Views
    7. Triggers
    8. PHP Implementation of SQLite
    9. Extending SQLiteDatabase
    10. Override the Query Methods
    11. Utility Methods
    12. User-Defined Functions
    13. Uses and Limitations of SQLite
  19. Using PDO
    1. Pros and Cons
    2. Converting the SQLite Application
    3. Additional Capabilities of PDO
    4. Assessment
  20. SETTING UP PHP 5
    1. php.ini Settings
  21. Conversion Table: PHP 4 AND PHP 5
  22. GLOSSARY
    1. A
    2. B
    3. C
    4. D
    5. E
    6. F
    7. G
    8. H
    9. I
    10. J
    11. M
    12. N
    13. P
    14. Q
    15. R
    16. S
    17. T
    18. W
    19. X
    20. Z
  23. Index