Home arrow PHP arrow Including Files Recursively with Loader Applications in PHP

Including Files Recursively with Loader Applications in PHP

Welcome to the fourth chapter of the series that shows you how to build loader applications with PHP. Made up of seven parts, this series uses a variety of code samples to teach you how to create modular programs. These programs are capable of recursively including files required by a given application, without having to explicitly call any “include()/include_once()” or “require()/require_once()” PHP function.

  1. Including Files Recursively with Loader Applications in PHP
  2. Review: the loader() class so far
  3. Recursively including PHP files
  4. Changing the location of required files
By: Alejandro Gervasio
Rating: starstarstarstarstar / 3
June 11, 2009

print this article



And now that you’ve been introduced to the main goal of this series, it’s time to summarize the topics that were discussed in the last tutorial. In the previous part I went through the development of a file loading class in PHP 5. This class was capable of searching recursively for a determined file on the web server, based on a starting path passed to its “load()” main method.

Having a class like this makes it much easier to dynamically load resources and dependencies that may be located in different folders on the server. Its recursive “load()” method does the hard work and takes care of the whole loading process, independently of the location of a required file. 

Nonetheless, the best way to understand how this loader class works and how functional it can be in concrete situations is by setting up several examples that show it in action. 

Bearing in mind this idea, in this fourth installment of the series I’m going to provide you with a number of code samples that will demonstrate the actual benefits of using the “Loader” class created in the preceding tutorial. 

Now, let’s leave the boring theory behind us and see the real functionality of this recursive file loader program. Let’s jump in!

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

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: