update auto_loader to use magic dir constant (#6963)
This commit is contained in:
@@ -56,11 +56,14 @@ class auto_loader {
|
|||||||
|
|
||||||
//use glob for a more extensive search for the classes (note: GLOB_BRACE doesn't work on some systems)
|
//use glob for a more extensive search for the classes (note: GLOB_BRACE doesn't work on some systems)
|
||||||
if (!class_exists($class_name)) {
|
if (!class_exists($class_name)) {
|
||||||
|
//set project path using magic dir constant
|
||||||
|
$project_path = dirname(__DIR__, 2);
|
||||||
|
|
||||||
//build the search path array
|
//build the search path array
|
||||||
$search_path[] = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/resources/classes/".$class_name.".php");
|
$search_path[] = glob($project_path . "/resources/classes/".$class_name.".php");
|
||||||
$search_path[] = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/resources/interfaces/".$class_name.".php");
|
$search_path[] = glob($project_path . "/resources/interfaces/".$class_name.".php");
|
||||||
$search_path[] = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/resources/classes/".$class_name.".php");
|
$search_path[] = glob($project_path . "/*/*/resources/classes/".$class_name.".php");
|
||||||
$search_path[] = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/resources/interfaces/".$class_name.".php");
|
$search_path[] = glob($project_path . "/*/*/resources/interfaces/".$class_name.".php");
|
||||||
|
|
||||||
//find the path
|
//find the path
|
||||||
$path = self::autoload_search($search_path);
|
$path = self::autoload_search($search_path);
|
||||||
|
|||||||
Reference in New Issue
Block a user