PHP
  Home arrow PHP arrow Using Introspective Methods with the D...
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 Introspective Methods with the DirectoryIterator Class in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 5
    2006-09-25

    Table of Contents:
  • Using Introspective Methods with the DirectoryIterator Class in PHP 5
  • The isDir() method
  • Using the isDot() method
  • Implementing the isExecutable(), isReadable() and isWritable() methods
  • The getPerms() and getType() methods

  • 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 Introspective Methods with the DirectoryIterator Class in PHP 5


    (Page 1 of 5 )

    If you’re one of those PHP developers who want to explore the package of classes that come bundled with the Standard PHP Library (SPL), then fear not, because you’re at the right place. Welcome to the concluding part of the series "A Close Look at the DirectoryIterator Class in PHP 5." In three parts, this series introduces the most important methods attached to this class, and shows you how to use them by mean of extensive hands-on examples.

    Introduction

    After this short introduction, allow me to recapitulate briefly the topics that I covered in the two previous articles. This will conveniently refresh your memory and get you back into the flow of the contents of this series.

    As you'll probably remember, over the course of the first article, I took an in-depth look at some of the core methods included within the "DiretoryIterator" class to demonstrate how a specified directory can be quickly traversed by a regular "foreach" language construct. In all the code samples that you saw, once an instance of the iterator class was properly created, the process for iterating over several directory entries was simplified to using the mentioned loop structure, in conjunction with a conventional array notation.

    Aside from depicting the entire process for traversing a given directory and accessing each of its elements, in the second part of this series, strong emphasis was put on covering some of the most relevant methods that come with the "DirectoryIterator" class. In accordance with this, you learned how to do all sorts of clever things, like finding paths and names of directory entries, as well as handling the corresponding timestamps.

    Perhaps you think that after having examined all the methods that I mentioned before, the tale of the "DirectoryIterator" class was already concluded. Well, not so fast; this class still has some additional methods that require special attention. For this reason, this last tutorial of the series will be focused mostly on covering all the methods related to performing some kind of introspective process, which can be quite useful when analyzing the types and permissions of each entry included in a given directory.

    Having established the goals of this tutorial, let's get started. Hopefully, this will be an educational experience!

    More PHP Articles
    More By Alejandro Gervasio


       · This last tutorial of the series is focused mostly on covering all the methods...
     

       

    PHP ARTICLES

    - 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
    - Handling Attachments in MIME Email with PHP
    - Completing the Project Management Application





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