From: Roland Haeder Date: Thu, 15 May 2014 19:20:29 +0000 (+0200) Subject: Check if path can be loadded before attempting it. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2b85c64a9fedc1f93ce3495a852113c3c5b651b2;p=core.git Check if path can be loadded before attempting it. Signed-off-by: Roland Häder --- 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 }