/** * @param $classPath * * @return null|string */ function glz_findClassPath($classPath) { if (!class_exists('org_glizy_Paths')) { return NULL; } $classPath = str_replace(array('.', '*'), '/', $classPath); $path = NULL; $searchPath = org_glizy_Paths::getClassSearchPath(); foreach ($searchPath as $p) { if (file_exists($p . $classPath)) { $path = $p . $classPath; break; } else { if (file_exists($p . $classPath . '.xml')) { $path = $p . $classPath . '.xml'; break; } else { if (file_exists($p . $classPath . '.php')) { $path = $p . $classPath . '.php'; break; } } } } return $path; }