<< back

Table of Contents  
   
   
Introduction 5
   
Chapter 1: Why Read This Book 6
Why Read This Book 7
Sample Job Description: Jr. PHP Developer 7
        The Eight Primary Categories of JQuery Features 7
Why Learn Object Oriented PHP 8
        Six Primary Advantages to Learning Object Oriented Programming 8
Setting Up Your Development Stack 8
        AMP, XAMP/WAMP, MAMP, LAMP 9
        Zend Server CE Download (MySQL, Apache, PHP, and ZendServer), System Requirements & Installation 10
        MySQL Workbench 5.2 CE Download & Installation 12
Setting Up Your Integrated Development Environment (IDE) 13
        Eclipse PDT (Helios Release) Download & Installation 13
   
Chapter 2: PHP Objects & Classes 16
Overview – The Confusion of First Learning Object Oriented Theory 17
Explanation of a Class 18
Explanation of an Object 19
Instantiation 19
$this Variable 20
Access Modifiers 20
Inheritance 22
Method Overriding 22
Invoking Parent Methods 23
Horizontal Inheritance - Using Traits 24
Encapsulation 25
Polymorphism 25
        Polymorphism vs. Method Overloading 25
        Polymorphism vs. Method Overriding 25
        Late Binding / Dynamic Binding 26
   
Chapter 3: PHP Magic Methods 28
__construct() 29
        Invoking Parent Constructor and Destructor 29
__destruct() 30
__get(), __set(), __isset() 30
__call() 32
__sleep() 33
__wakeup() 34
__clone() 35
 
Chapter 4: Abstract Classes & Methods 37
abstract Keyword 38
Extending sub-classes from an Abstract Base Class 39
Abstract Methods 40
final Keyword 41
 
Chapter 5: Interfaces 42
PHP Interfaces 43
        Explanation of What Interfaces Are and Why They are Useful 43
interface & implements Keywords 45
        Implementing Multiple Interfaces 46
        Programming to the Interface 46
                Design-by-Contract 50
   
Chapter 6: Static Methods & Properties 50
The static Modifier 51
The Scope Resolution Operator 52
Static Properties 59
Static Methods 60
        Singleton Pattern 60
Late Static Binding 62
        The static Keyword vs. the self Keyword 63
   
Chapter 7: PHP Error Control & Exception Handling 62
The Built-in Exception Class 63
Throwing an Exception 63
        The try-catch-finally Block 66
Setting the Desired Error Sensitivity Level 66
        Setting Error Reporting 67
        Error Reporting Sensitivity Levels 67
                Displaying Startup Errors 67
                Logging Errors 67
                Identifying the Log File 67
                Setting the Maximum Log Line Length 67
                Ignoring Repeated Errors 67
                Ignoring Errors Originating from the Same Location 67
                Storing Most Recent Error in a Variable 68
                Opening the Logging Connection 68
Logging Options 68
                Closing the Logging Connection 69
   
Chapter 8: The Model, View, Controller Design Pattern 75
Understanding the Model-View-Controller Design Pattern 76
        Model 76
        View 76
        Controller 76
The MCV URL Structure & URL Mapping 76
        Using the .htaccess File 76
The index.php File 77
The MVC Folder Structure 77
Custom MVC Application - Restaurant Menu Management Application 77
        Showing the Menu 81
        Adding a Menu Item 89
        Assigning a Menu Item to a Menu 93
        Editing/Deleting Menu Items 97
                Download the Source Code for the Custom MVC Application (Restaurant Menu Management Application) 101
   
Chapter 9: The Reflection API 102
Using the export Method 104
The Reflection Class 104
 
Chapter 10: The PEAR Library 109
Overview of PEAR 110
Install PEAR on a Zend Framework Environment on Windows 110
Install PEAR on a Windows XAMPP Environment 112
Install PEAR on a Windows WAMP Environment 113
Install PEAR on a Mac OS 113
Install PEAR on Linux 114
PEAR CAPTCHA Example 114
   
Chapter 11: Unit Testing with PHPUnit 119
Overview of Unit Testing with PHPUnit 120
Installing PHPUnit 121
Install PHPUnit on Windows in Zend Framework Environment 121
Install PHPUnit on Windows in XAMPP Environment 121
Install PHPUnit on a Mac OS 121
Install PHPUnit on Linux 121
Test fixtures 121
Test Phases 122
Writing Test Cases 122
Assertion Methods 122
Testing Data from HTML Form Submissions 127
Test suites 127
Mocks and Stubs 128
        TestCase Matcher Methods 129
Running PHPUnit from Eclipse Without Plug-ins 130
 
Chapter 12: SVN - Source Code Management with Subversion 132
Windows 134
        Setting Up a Subversion Server and Client on Windows 136
        Adding Your Source Code the First Time 138
        Creating a Copy to Work On 138
        Updating and Committing Your Working Copy 138
        Setting up TortoiseSVN 138
        Trunk, Tags & Branches 140
        Exporting a Release 144
        Tagging & Branching a File 144
Mac OS X 145
        Setting Up a Subversion Server and Client on Mac OS X 145
                Download Subversion 145
                Unpack and Install Subversion 145
                Add Subversion to Your Path 145
        Setting up the Subversion Repository 145
        Creating a Subversion Project 144
        Checking Out Files from Subversion 144
        Updating and Committing Changes 145
        Adding and Removing Files and Directories 145
        Tagging & Exporting a Release 146
        Branching & Merging a Project 146
        Graphical User Interfaces 148
Linux 148
        Setting Up a Subversion Server on a Linux Server 148
                Download Subversion 149
                Setting up the Subversion Repository 149
        Creating a Subversion Project 150
        Checking Out Files from Subversion 150
        Updating and Committing Changes 151
        Adding and Removing Files and Directories 151
        Tagging & Exporting a Release 152
        Branching & Merging a Project 153
   
Summary 157
   
Appendix A 159
        Bibliography 159
                Books 159
                Websites 159

<< back