From: Roland Häder Date: Wed, 15 Mar 2017 11:52:06 +0000 (+0100) Subject: better this way, "cache" loader instance to avoid calling getSelfInstance() X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=bcc4c93c61443966ab39195d81ff9ecd26068b94 better this way, "cache" loader instance to avoid calling getSelfInstance() Signed-off-by: Roland Häder --- diff --git a/framework/loader/class_ClassLoader.php b/framework/loader/class_ClassLoader.php index 6911f053..05603620 100644 --- a/framework/loader/class_ClassLoader.php +++ b/framework/loader/class_ClassLoader.php @@ -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