Code syncronized with shipsimu code base
[mailer.git] / inc / loader / class_ClassLoader.php
index fa9c771d9f23912c58b003725cf68f51d0917c5a..7297c7d199355193949bb933514ff1e88c3d7fff 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -240,7 +240,7 @@ class ClassLoader {
 
                // If the basePath is false it is invalid
                if ($basePath2 === false) {
-                       // TODO: Do not die here.
+                       /* @todo: Do not die here. */
                        die("Cannot read {$basePath} !");
                } else {
                        // Set base path
@@ -309,16 +309,18 @@ class ClassLoader {
                // Now look it up in our index
                if (isset($this->classes[$fileName])) {
                        // File is found so load it only once
+                       //* DEBUG: */ echo "LOAD: ".$fileName." - Start<br />\n";
                        require($this->classes[$fileName]);
+                       //* DEBUG: */ echo "LOAD: ".$fileName." - End<br />\n";
 
                        // Count this include
                        $this->total++;
 
+                       // Mark this class as loaded
+                       $this->loadedClasses[] = $this->classes[$fileName];
+
                        // Developer mode excludes caching (better debugging)
                        if (!defined('DEVELOPER')) {
-                               // Mark this class as loaded
-                               $this->loadedClasses[] = $this->classes[$fileName];
-
                                // Reset cache
                                $this->classesCached = false;
                        } // END - if
@@ -352,6 +354,22 @@ class ClassLoader {
        public final function getTotal () {
                return $this->total;
        }
+
+       /**
+        * Getter for a printable list of included classes/interfaces/exceptions
+        *
+        * @param       $includeList    A printable include list
+        */
+       public function getPrintableIncludeList () {
+               // Prepare the list
+               $includeList = "";
+               foreach ($this->loadedClasses as $classFile) {
+                       $includeList .= basename($classFile)."<br />\n";
+               } // END - foreach
+
+               // And return it
+               return $includeList;
+       }
 }
 
 // [EOF]