function findIncludeClass($dirname, $classname) { $dirhandle = opendir($dirname); while (false !== ($filename = readdir($dirhandle))) { if ($filename != '.' && $filename != '..' && $filename != '') { if ($filename == 'class.' . $classname . '.php' || $filename == 'abstract.' . $classname . '.php' || $filename == 'interface.' . $classname . '.php') { include $dirname . $filename; return; } if (is_dir($dirname . $filename)) { findIncludeClass($dirname . $filename . '/', $classname); } } } closedir($dirhandle); }
function findIncludeClass($dirname, $classname) { $dirhandle = opendir($dirname); while (false !== ($filename = readdir($dirhandle))) { if ($filename != '.' && $filename != '..' && $filename != '') { if ($filename == 'class.' . $classname . '.php' || $filename == 'abstract.' . $classname . '.php' || $filename == 'interface.' . $classname . '.php') { include $dirname . $filename; return; } // added for using the system copy of PHPMailer if ($classname == 'PHPMailer' || $classname == 'SMTP') { findIncludeClass($dirname . '/', strtolower($classname)); return; } if (is_dir($dirname . $filename)) { findIncludeClass($dirname . $filename . '/', $classname); } } } closedir($dirhandle); }