Source for file include_all.php

Documentation is available at include_all.php

  1. <?php
  2.  
  3. /**
  4. * This file will include all of the OSID class definitions in the org/osid/
  5. * subdirectory.
  6. * You may fine it more useful to include_once any given interface directly
  7. * from classes extending it.
  8. *
  9. * @package org
  10. *
  11. * @version $Id: include_all.php,v 1.3 2005/02/04 15:59:13 adamfranco Exp $
  12. * @since $Date: 2005/02/04 15:59:13 $
  13. * @copyright 2004 Middlebury College
  14. * @author Adam Franco <afranco AT middlebury DOT edu>
  15. */
  16.  
  17.  
  18.  
  19. $osidDir = realpath(dirname(__FILE__)."/org/osid");
  20.  
  21. includePHPFiles ($osidDir);
  22.  
  23. /**
  24. * Recursively include_once all php files in the target directory.
  25. *
  26. * @param string $dir The target directory
  27. * @return void
  28. * @access public
  29. * @since 1/7/05
  30. */
  31. function includePHPFiles ( $dir ) {
  32. if ($handle = opendir($dir)) {
  33.  
  34. while (false !== ($fileName = readdir($handle))) {
  35. $file = realpath($dir."/".$fileName);
  36. // If the child is a directory, recuse into it
  37. if (is_dir($file) && $fileName != "." && $fileName != "..") {
  38. includePHPFiles($file);
  39. }
  40. // If it is a php file, include it.
  41. else if (ereg(".php$", $file)) {
  42. include_once($file);
  43. }
  44. // Otherwise, just ignore the file.
  45. }
  46. closedir($handle);
  47. } else {
  48. die ("Could not open $dir");
  49. }
  50. }
  51. ?>

Documentation generated on Wed, 19 Sep 2007 10:24:39 -0400 by phpDocumentor 1.3.0RC3