SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 4 | Next

Hasin Hayder

"Object-Oriented Programming with PHP5"

BangladeshInfo.com
& Global Online Services Limited are both a concern of Texas Group Bangladesh and
a renowned IT firm in the local market for corporate and multinational companies.
He also worked in THPB (The Hunger Project, Bangladesh -
http://www.thp.org) and SHUJAN (SHUJAN is a citizen movements to
achieve good governance) as a lead developer for developing various e-governance
sites for increasing the accountability of the candidates of national elections.
From SHUJAN (http://www.shujan.org) he also developed the country's first
ever online.
Table of Contents
Introduction 1
Chapter 1: OOP vs. Procedural Programming 5
Introduction to PHP 6
A Little History of OOP in PHP 6
Procedural vs. OO Coding Style 7
Benefits of OOP 8
Dissection of an Object 9
Difference of OOP in PHP4 and PHP5 11
Some Basic OO Terms 12
General Coding Conventions 13
Summary 14
Chapter 2: Kick-Starting OOP 15
Let's Bake Some Objects 15
Accessing Properties and Methods from Inside the Class 17
Using an Object 17
Modifiers 18
Constructors and Destructors 20
Class Constants 22
Extending a Class [Inheritance] 24
Overriding Methods 26
Preventing from Overriding 26
Preventing from Extending 26
Polymorphism 27
Interface 28
Abstract Class 30
Static Method and Properties 32
Table of Contents
[ ii ]
Accessor Methods 34
Using Magic Methods to Set/Get Class Properties 36
Magic Methods for Overloading Class Methods 37
Visually Representing a Class 38
Summary 39
Chapter 3: More OOP 41
Class Information Functions 41
Checking if a Class Already Exists 41
Finding Currently Loaded Classes 42
Finding out if Methods and Properties Exists 42
Checking the Type of Class 42
Finding Out the Class Name 43
Exception Handling 44
Collecting all PHP Errors as Exception 48
Iterators 49
ArrayObject 51
Array to Object 52
Accessing Objects in Array Style 53
Serialization 54
Magic Methods in Serialization 55
Object Cloning 58
Autoloading Classes or Classes on Demand 59
Method Chaining 59
Life Cycle of an Object in PHP and Object Caching 61
Summary 62
Chapter 4: Design Patterns 63
You Might have Done this Before??¦ 63
Strategy Pattern 64
Factory Pattern 66
Abstract Factory 69
Adapter Pattern 71
Singleton Pattern 75
Iterator Pattern 77
Observer Pattern 80
Proxy Pattern or Lazy Loading 82
Decorator Pattern 84
Active Record Pattern 88
Facade Pattern 88
Summary 91
Table of Contents
[ iii ]
Chapter 5: Reflection and Unit Testing 93
Reflection 93
ReflectionClass 94
ReflectionMethod 99
ReflectionParameter 102
ReflectionProperty 104
Unit Testing 106
Benefits of Unit Testing 107
A small Introduction to Vulnerable Bugs 107
Preparing for Unit Testing 109
Starting Unit Testing 109
Testing an Email Validator Object 112
Unit Testing for Everyday Script 116
Test Driven Development 120
Writing Multiple Assertions 125
PHPUnit API 126
Summary 136
Chapter 6: Standard PHP Library 137
Available Objects in SPL 137
ArrayObject 138
ArrayIterator 143
DirectoryIterator 145
RecursiveDirectoryIterator 149
RecursiveIteratorIterator 150
AppendIterator 150
FilterIterator 152
LimitIterator 154
NoRewindIterator 154
SeekableIterator 155
RecursiveIterator 156
SPLFileObject 158
SPLFileInfo 159
SPLObjectStorage 161
Summary 163
Chapter 7: Database in an OOP Way 165
Introduction to MySQLi 165
Connecting to MySQL in an OO Way 166
Selecting Data in an OO Way 166
Updating Data in an OO Way 167
Table of Contents
[ iv ]
Prepared Statements 167
Basic Prepared Statements 168
Prepared Statements with Variables 169
Using BLOB with Prepared Statements 170
Executing Stored Procedure with MySQLi and PHP 171
PDO 172
DSN Settings for Different Databases Engines 174
Using Prepared Statements with PDO 175
Calling Stored Procedures 176
Other Interesting Functions 177
Introduction to Data Abstraction Layers 178
ADOdb 178
Installing ADOdb 178
Connecting to Different Databases 179
Basic Database Operations using ADOdb 183
Inserting, Deleting, and Updating Records 184
Executing Prepared Statements 184
MDB2 185
Installing MDB2 185
Connecting to Database 186
Executing Prepared Statements 187
Introduction to ActiveRecord 188
Creating a New Record via ActiveRecord 189
Selecting and Updating Data 189
Summary 190
Chapter 8: Cooking XML with OOP 191
Formation of XML 191
Introduction to SimpleXML 192
Parsing Documents 193
Accessing Attributes 194
Parsing Flickr Feeds using SimpleXML 194
Managing CDATA Sections using SimpleXML 197
XPath 198
DOM API 200
Modifying Existing Documents 202
Other Useful Functions 202
Summary 203
Chapter 9: Building Better with MVC 205
What is MVC? 205
Planning for the Project 206
Designing the Bootstrap File 206
Table of Contents
[ v ]
Adding Database Support 224
Drivers 227
Building Applications over our Framework 237
Authentication Controller 238
Summary 245
Index 247
Introduction
Object-oriented programming is largely about the ability to hide what's not important
to the user and to highlight what is.


Pages:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6