From bcc4c93c61443966ab39195d81ff9ecd26068b94 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 15 Mar 2017 12:52:06 +0100 Subject: [PATCH] better this way, "cache" loader instance to avoid calling getSelfInstance() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- framework/loader/class_ClassLoader.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 2.30.2