PHP
  Home arrow PHP arrow Working Out of the Object Context to Build Loader Apps in 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

Working Out of the Object Context to Build Loader Apps in PHP
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 2
    2009-06-25


    Table of Contents:
  • Working Out of the Object Context to Build Loader Apps in PHP
  • Review: recursive file loading program
  • Improving the definition of the Loader class
  • The Loader class in action

  • 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


    Working Out of the Object Context to Build Loader Apps in PHP
    ( Page 1 of 4 )

    Welcome to the fifth part of an eight-part article series that teaches you how to build loader applications with PHP. In this installment of the series, I explain how to create a small, efficient file loader class, with a difference: no instance of it needs to be spawned to include a targeted file, thanks to the implementation of a static recursive loading method.

    Building small programs with PHP that can load a specified file or resource is an easily-tackled process for many developers with only average experience in the language. However, things can get more complex when trying to add some useful characteristics to these programs, such as recursive file search capabilities and exception handling. This requires a more intimate knowledge of the object paradigm and mastering some features that are only present in PHP 5.

    Not all is lost, though, if you're trying to build this kind of file loading application, since this group of articles will guide you through the entire development process in a truly friendly way, using a strong hands-on approach. 

    Of course, if you've been a patient reader who already went through all of the preceding articles of this series, then you probably have a solid background in how to create some handy file loading programs with PHP 5. In the aforementioned tutorials I discussed their construction, and once the basic concepts  were properly covered, I proceeded to implement a few useful features, such as the capacity for including a specified file by means of recursive searches, using a starting file path. 

    The file loader class developed in the last chapter had a "load()" method that implemented this recursive ability in a truly straightforward fashion. Nevertheless, it's valid to stress here that it's necessary to create an instance of this class to include a determined file, except in those cases where its loading method is called statically. 

    However, to avoid an eventual (and unnecessary) instantiation of the loader class, it would be helpful to declare the mentioned "load()" method static. Thus, bearing in mind this important concept, in this fifth part of the series I'm going to enhance the signature of the "Loader" class created previously by turning its loading method into a static one. 

    Want to learn the full details of how this will be accomplished in a few simple steps? Then don't waste more time; start reading now!



     
     
    >>> More PHP Articles          >>> More By Alejandro Gervasio
     

       

    PHP ARTICLES

    - 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
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5





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