X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Floader%2Fclass_ClassLoader.php;h=2d36b78a337014782b06d50b8988f34fb24da2a7;hb=1e2209b0314919177e08f7ec626e9eb2e1f90d70;hp=06b8fd82c07e666f9d9e63aecd22e9c2958ed738;hpb=1cfec479b8c4a745b5b97683d22c8a431f9a3ee7;p=shipsimu.git diff --git a/inc/loader/class_ClassLoader.php b/inc/loader/class_ClassLoader.php index 06b8fd8..2d36b78 100644 --- a/inc/loader/class_ClassLoader.php +++ b/inc/loader/class_ClassLoader.php @@ -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 @@ -314,11 +314,11 @@ class ClassLoader { // 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 +352,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)."
\n"; + } // END - foreach + + // And return it + return $includeList; + } } // [EOF]