]> git.mxchange.org Git - core.git/blobdiff - inc/loader/class_ClassLoader.php
Fixed tableName issue
[core.git] / inc / loader / class_ClassLoader.php
index 0a07ba20eee63472625cda6f53e94cb40d7d3b51..7b6bb2dd1a32b6d38607249a97cab86861a6d955 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -104,7 +104,7 @@ class ClassLoader {
        private static $frameworkPaths = array(
                'exceptions', // Exceptions
                'interfaces', // Interfaces
-               'main',       // General main classes
+               'classes',    // Classes
                'middleware'  // The middleware
        );
 
@@ -133,7 +133,7 @@ class ClassLoader {
                // Skip here if already cached
                if ($this->listCached === FALSE) {
                        // Writes the cache file of our list away
-                       $cacheContent = serialize($this->classes);
+                       $cacheContent = json_encode($this->classes);
                        file_put_contents($this->listCacheFQFN, $cacheContent);
                } // END - if
 
@@ -178,9 +178,9 @@ class ClassLoader {
                $loaderInstance = self::getSelfInstance();
 
                // Load all classes
-               foreach (self::$frameworkPaths as $className) {
+               foreach (self::$frameworkPaths as $pathName) {
                        // Try to load the framework classes
-                       $loaderInstance->scanClassPath('inc/classes/' . $className . '/');
+                       $loaderInstance->scanClassPath('inc/main/' . $pathName . '/');
                } // END - foreach
        }
 
@@ -235,19 +235,19 @@ class ClassLoader {
                } // END - if
 
                // IS the cache there?
-               if (file_exists($this->listCacheFQFN)) {
+               if (BaseFrameworkSystem::isReadableFile($this->listCacheFQFN)) {
                        // Get content
                        $cacheContent = file_get_contents($this->listCacheFQFN);
 
                        // And convert it
-                       $this->classes = unserialize($cacheContent);
+                       $this->classes = json_decode($cacheContent);
 
                        // List has been restored from cache!
                        $this->listCached = TRUE;
                } // END - if
 
                // Does the class cache exist?
-               if (file_exists($this->classCacheFQFN)) {
+               if (BaseFrameworkSystem::isReadableFile($this->listCacheFQFN)) {
                        // Then include it
                        require($this->classCacheFQFN);
 
@@ -462,7 +462,7 @@ class ClassLoader {
        }
 
        /**
-        * Getter for a printable list of included classes/interfaces/exceptions
+        * Getter for a printable list of included main/interfaces/exceptions
         *
         * @param       $includeList    A printable include list
         */