autoload.inc

Go to the documentation of this file.
00001 <?php
00002 
00015 function __load_class($classname, $dir)
00016 {
00017     $file = $dir . '/' . $classname . '.inc';
00018     if (file_exists($file))
00019     {
00020         require_once($file);
00021         return true;
00022     }
00023     return false;
00024 }
00025 
00034 function __autoload($classname) {
00035     $classname = strtolower($classname);
00036     $inc = split(':', ini_get('include_path'));
00037     $inc[] = '.';
00038     $inc[] = dirname($_SERVER['PATH_TRANSLATED']);
00039     foreach($inc as $dir)
00040     {
00041         if (__load_class($classname, $dir))
00042         {
00043             fprintf(STDERR, 'Loading class('.$classname.")\n");
00044             return;
00045         }
00046     }
00047     fprintf(STDERR, 'Class not found ('.$classname.")\n");
00048 }
00049 
00050 ?>

Generated on Thu Apr 26 01:04:46 2007 for SPL-StandardPHPLibrary by  doxygen 1.5.2