PHP
  Home arrow PHP arrow Using Directory Iterators and MySQL with Adapter Objects with PHP
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
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? 
Google.com  
PHP

Using Directory Iterators and MySQL with Adapter Objects with PHP
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 6
    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:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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
     

       

    PHP ARTICLES

    - Implementing Factory Methods in PHP 5
    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek