Exemple #1
0
 public static function requireAllFilesInDirectory($dir)
 {
     if (is_dir($dir) && ($dh = opendir($dir))) {
         while (($file = readdir($dh)) !== false) {
             if (is_dir($dir . DIRECTORY_SEPARATOR . $file)) {
                 if ($file != '.' && $file != '..') {
                     SJB_System::requireAllFilesInDirectory($dir . DIRECTORY_SEPARATOR . $file);
                 }
             } else {
                 if (strlen($file) > 4 && strtolower(substr($file, strlen($file) - 4)) == '.php') {
                     require_once $dir . DIRECTORY_SEPARATOR . $file;
                 }
             }
         }
         closedir($dh);
     }
 }