Code sync from ship-simu code (all class config entries must end with _class!)
[mailer.git] / inc / loader / class_ClassLoader.php
index 869f4c2b24944c1a9fb27da2ef718fb3a94f2f69..fa9c771d9f23912c58b003725cf68f51d0917c5a 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -102,6 +102,11 @@ class ClassLoader {
         */
        private $classCacheFQFN = "";
 
+       /**
+        * Counter for loaded include files
+        */
+       private $total = 0;
+
        /**
         * The *public* constructor
         *
@@ -236,7 +241,6 @@ class ClassLoader {
                // If the basePath is false it is invalid
                if ($basePath2 === false) {
                        // TODO: Do not die here.
-                       debug_print_backtrace();
                        die("Cannot read {$basePath} !");
                } else {
                        // Set base path
@@ -307,6 +311,9 @@ class ClassLoader {
                        // File is found so load it only once
                        require($this->classes[$fileName]);
 
+                       // Count this include
+                       $this->total++;
+
                        // Developer mode excludes caching (better debugging)
                        if (!defined('DEVELOPER')) {
                                // Mark this class as loaded
@@ -336,6 +343,15 @@ class ClassLoader {
                        } // END - if
                } // END - foreach
        }
+
+       /**
+        * Getter for total include counter
+        *
+        * @return      $total  Total loaded include files
+        */
+       public final function getTotal () {
+               return $this->total;
+       }
 }
 
 // [EOF]