PHP
  Home arrow PHP arrow Using Directory Iterators and MySQL wi...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Using Directory Iterators and MySQL with Adapter Objects with PHP
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 5
    2006-12-13

    Table of Contents:
  • Using Directory Iterators and MySQL with Adapter Objects with PHP
  • Working with directory iterators and adapters together
  • Putting the adapter class to work
  • Adapting MySQL result sets

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Using Directory Iterators and MySQL with Adapter Objects with PHP


    (Page 1 of 4 )

    If you’re a PHP programmer who’s searching for a comprehensive tutorial on how to create adapter classes with PHP 5, them look no further. Welcome to the final installment of the series “Implementing adapter objects with PHP.” Made up of two parts, this series teaches you how to implement the adapter design pattern in PHP 5, and it accompanies the corresponding theory with educational examples.

    Quite possibly, you'll remember that in the first part of the series I went through the definition and application of this design pattern, and additionally provided you with some illustrative code samples to demonstrate how the functionality of a given class can be easily expanded without using inheritance.

    Now, speaking more specifically, you'll recall that the hands-on example that I developed in the first article was focused on creating a directory adapter class. This class was originally defined for extending the functionality of another one, in this case conceived as a generic directory processor.

    Of course, the best thing about building an adapter class rests on the fact that this process is entirely performed without the need to use a more conventional approach, such as applying inheritance.

    However, it should be noticed that the implementation of the adapter pattern with PHP is applicable particularly in those situations where working directly with subclasses is nearly impossible, or when a certain application has been so poorly developed that the only way to tackle a specific problem is by defining a new class that conforms to a predefined model.

    In all other situations, inheritance is probably the best approach to follow when the functionality of an existing class must be extended inside the context of a given application.

    All right, now that I recapitulated quickly the topics covered in the first article, let me tell you what you'll learn in this one. Provided that you understand the basic concepts of the adapter pattern, in this final tutorial, I'll show you how to use it in conjunction with the "DirectoryIterator" class, bundled with PHP 5, and with a couple of MySQL wrappers as well.

    Having established the subject of this article, let's get started.

    More PHP Articles
    More By Alejandro Gervasio


       · In this final tutorial of the series, you'll learn how to use the adapter pattern in...
     

       

    PHP ARTICLES

    - Validating Web Forms with the Code Igniter P...
    - Output Buffering
    - Paginating Database Records with the Code Ig...
    - HTTP Headers in Web Development
    - Project Management: Administration
    - Building a Database-Driven Application with ...
    - User Authentication for a Project Management...
    - Introduction to the CodeIgniter PHP Framework
    - Adding Users for a Project Management Applic...
    - Migrating Class Code for a MIME Email to PHP...
    - Login and Logout Authentication for a Projec...
    - Composing Messages in HTML for MIME Email wi...
    - Project Management: Authentication
    - A Better Way to Determine MIME Types for MIM...
    - Project Management Overview





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway