Check if path can be loadded before attempting it.
authorRoland Haeder <roland@mxchange.org>
Thu, 15 May 2014 19:20:29 +0000 (21:20 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 15 May 2014 19:20:29 +0000 (21:20 +0200)
Signed-off-by: Roland H├Ąder <roland@mxchange.org>
inc/loader/class_ClassLoader.php

index cc7bb81..eea5580 100644 (file)
@@ -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
        }