better this way, "cache" loader instance to avoid calling getSelfInstance()
[core.git] / framework / loader / class_ClassLoader.php
index 6911f053e24c24fb0c9a4762b0401277db1cec5e..0560362015876308c5d86c846d46d652bb4f3634 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