public static function recursive_autoload($file, $path, $flag) { if (FALSE !== ($handle = opendir($path)) && $flag) { while (FAlSE !== ($dir = readdir($handle)) && $flag) { if (strpos($dir, '.') === FALSE) { $path2 = $path . '/' . $dir; $filepath = $path2 . '/' . $file . '.php'; if (file_exists($filepath)) { $flag = FALSE; require_once $filepath; break; } Autoloader::recursive_autoload($file, $path2, $flag); } } closedir($handle); } }
public static function recursive_autoload($file, $path) { if (FALSE !== ($handle = opendir($path))) { // search recursively the specified file while (FAlSE !== ($dir = readdir($handle))) { if (strpos($dir, '.') === FALSE) { $path .= '/' . $dir; $filepath = $path . '/' . $file . '.php'; if (file_exists($filepath)) { require_once $filepath; break; } Autoloader::recursive_autoload($file, $path); } } closedir($handle); } }
public static function recursive_autoload($file, $path, $flag) { if (FALSE !== ($handle = opendir($path)) && $flag) { while (FAlSE !== ($dir = readdir($handle)) && $flag) { if (strpos($dir, '.') === FALSE) { $path2 = $path . '/' . $dir; $filepath = $path2 . '/' . $file . '.php'; if (Autoloader::debug) { Autoloader::StPutFile('ищем файл <b>' . $file . '</b> in ' . $filepath); } if (file_exists($filepath)) { if (Autoloader::debug) { Autoloader::StPutFile('подключили ' . $filepath); } $flag = FALSE; require_once $filepath; break; } Autoloader::recursive_autoload($file, $path2, &$flag); } } closedir($handle); } }