From 2b85c64a9fedc1f93ce3495a852113c3c5b651b2 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 15 May 2014 21:20:29 +0200 Subject: [PATCH] Check if path can be loadded before attempting it. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- inc/loader/class_ClassLoader.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/inc/loader/class_ClassLoader.php b/inc/loader/class_ClassLoader.php index cc7bb815..eea55805 100644 --- a/inc/loader/class_ClassLoader.php +++ b/inc/loader/class_ClassLoader.php @@ -195,8 +195,14 @@ class ClassLoader { // Load all classes for the application foreach (self::$frameworkPaths as $class) { - // Try to load the application classes - ClassLoader::getSelfInstance()->scanClassPath(sprintf('%s/%s/%s', $cfg->getConfigEntry('application_path'), $cfg->getConfigEntry('app_name'), $class)); + // Create path name + $path = sprintf('%s/%s/%s', $cfg->getConfigEntry('application_path'), $cfg->getConfigEntry('app_name'), $class); + + // Is the path readable? + if (is_dir($path)) { + // Try to load the application classes + ClassLoader::getSelfInstance()->scanClassPath($path); + } // END - if } // END - foreach } -- 2.39.5