better this way, "cache" loader instance to avoid calling getSelfInstance()
authorRoland Häder <roland@mxchange.org>
Wed, 15 Mar 2017 11:52:06 +0000 (12:52 +0100)
committerRoland Häder <roland@mxchange.org>
Wed, 15 Mar 2017 11:52:06 +0000 (12:52 +0100)
Signed-off-by: Roland Häder <roland@mxchange.org>
framework/loader/class_ClassLoader.php

index 6911f05..0560362 100644 (file)
@@ -204,7 +204,7 @@ class ClassLoader {
                // Trace message
                //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
 
-               // Cache loader instance
+               // Get loader instance
                $loaderInstance = self::getSelfInstance();
 
                // Get config instance
@@ -251,6 +251,9 @@ class ClassLoader {
                // Trace message
                //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
 
+               // Get loader instance
+               $loaderInstance = self::getSelfInstance();
+
                // Get config instance
                $cfg = FrameworkConfiguration::getSelfInstance();
 
@@ -273,7 +276,7 @@ class ClassLoader {
                        // Is the path readable?
                        if (is_dir($pathName)) {
                                // Try to load the application classes
-                               ClassLoader::getSelfInstance()->scanClassPath($pathName);
+                               $loaderInstance->scanClassPath($pathName);
                        } // END - if
                } // END - foreach