PHP
  Home arrow PHP arrow Working with Directory Iterators and P...
Dev Shed Forums 
Administration  
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 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
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

Working with Directory Iterators and Proxy Classes with PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2007-01-09

    Table of Contents:
  • Working with Directory Iterators and Proxy Classes with PHP 5
  • Defining the initial structure of a proxy directory class
  • Improving the functionality of the proxy class
  • Completing the proxy pattern
  • Developing a final example

  • 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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Working with Directory Iterators and Proxy Classes with PHP 5
    (Page 1 of 5 )

    If you’re a strong advocate of using pattern-based programming for developing your PHP applications, then this pair of comprehensive tutorials might find a place on your quick reference list. Welcome to the concluding part of the series “Building Proxy Classes with PHP 5.” In two parts, this series introduces the foundations of how to apply the proxy pattern with PHP 5, and it accompanies the corresponding theory with extensive code samples.

    Before I go deeper into the subject of this final article, let me refresh quickly the topics that I covered in the preceding article. As you'll possibly recall, over the course of the first part of the series, I explained the core concepts related to applying the proxy design pattern in PHP 5.

    However, if this pattern is still a pretty unfamiliar thing to you, allow me to explain briefly what it does. Basically, in the proxy pattern, a class (in this case, it's called "proxy") accesses all the methods that belong to other classes. In other words, the proxy acts like an intermediate entity for a selected object, a fact that reminds one closely the behavior of different proxy servers.

    So, having defined the basic logic that drives this pattern, the question is: why would we use it? Well, to be frank, the pattern can be used in those cases where you want to avoid an unnecessary instantiation of a given class, which will be used only when the application you're working with really demands it. At first glance, this may seem like an insignificant benefit if you're trying to boost the overall performance of your web applications, but there are times that working with many objects at the same time can bring about a notable overload on the server.

    So far, so good. Assuming that the proxy pattern isn't an unknown topic to you anymore, let me tell you what this final article is about. Since in the first part of the series I showed you how to create a proxy class for processing simple XML strings, in this installment I'm going to teach you how to create a proxy object that can be used in conjunction with the "DirectoryIterator" class that comes with PHP 5.

    Does this sound interesting and educational to you? Then it's time to learn how to couple proxy classes and iterators. Let's get started!

    More PHP Articles
    More By Alejandro Gervasio


       · Over this final installment of the series, you'll learn how to create proxy objects,...
     

       

    PHP ARTICLES

    - Setting Up a Web-based Image Hosting Service
    - Comparing Files and Databases with PHP Bench...
    - Setting Up a Web-Based Image Gallery
    - Using Timers to Benchmark PHP Applications
    - Benchmarking Applications with PHP
    - Setting Up a Web-Based File Manager: PHPfile...
    - Developing a Modular Class For a PHP File Up...
    - Setting Up a Web-Based File Manager: bfExplo...
    - Defining a Custom Function for File Uploader...
    - Parsing Child Nodes with the DOM XML extensi...
    - Creating an Error Handling Module for a PHP ...
    - Accessing Attributes and Cloning Nodes with ...
    - Retrieving Information on Selected Files wit...
    - Handling HTML Strings and Files with the DOM...
    - Building File Uploaders with PHP 5




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