X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=framework%2Floader%2Fclass_ClassLoader.php;h=5035d3f83cce41ea94ec6edf90f4a824a67f15e6;hp=63f6d00d280c83ba0fee3277b74321c7a814ab64;hb=868c877607670760eb36e63ebeb1a04237907be9;hpb=b9bfbe86c031c9d83c3670602906df191a33ba2a diff --git a/framework/loader/class_ClassLoader.php b/framework/loader/class_ClassLoader.php index 63f6d00d..5035d3f8 100644 --- a/framework/loader/class_ClassLoader.php +++ b/framework/loader/class_ClassLoader.php @@ -1,10 +1,10 @@ current(); // Get filename from iterator which is the class' name (according naming-convention) - $fileName = $currentEntry->getFileName(); + $fileName = $currentEntry->getFilename(); // Current entry must be a file, not smaller than 100 bytes and not on ignore list if ((!$currentEntry->isFile()) || (in_array($fileName, $this->ignoreList)) || ($currentEntry->getSize() < 100)) { @@ -484,6 +484,31 @@ class ClassLoader { } // END - while } + /** + * Getter for total include counter + * + * @return $total Total loaded include files + */ + public final function getTotal () { + return $this->total; + } + + /** + * Getter for a printable list of included main/interfaces/exceptions + * + * @param $includeList A printable include list + */ + public function getPrintableIncludeList () { + // Prepare the list + $includeList = ''; + foreach ($this->loadedClasses as $classFile) { + $includeList .= basename($classFile) . '
' . PHP_EOL; + } // END - foreach + + // And return it + return $includeList; + } + /** * Initializes our loader class * @@ -548,9 +573,9 @@ class ClassLoader { $classNameParts = explode("\\", $className); // At least 3 parts should be there - if ((self::$strictNamingConvention === true) && (count($classNameParts) < 3)) { + if ((self::$strictNamingConvention === true) && (count($classNameParts) < 5)) { // Namespace scheme is: Project\Package[\SubPackage...] - throw new InvalidArgumentException(sprintf('Class name "%s" is not conform to naming-convention: Project\Package[\SubPackage...]\SomeFooBar', $className)); + throw new InvalidArgumentException(sprintf('Class name "%s" is not conform to naming-convention: Tld\Domain\Project\Package[\SubPackage...]\SomeFooBar', $className)); } // END - if // Get last element @@ -589,29 +614,4 @@ class ClassLoader { } } - /** - * Getter for total include counter - * - * @return $total Total loaded include files - */ - public final function getTotal () { - return $this->total; - } - - /** - * Getter for a printable list of included main/interfaces/exceptions - * - * @param $includeList A printable include list - */ - public function getPrintableIncludeList () { - // Prepare the list - $includeList = ''; - foreach ($this->loadedClasses as $classFile) { - $includeList .= basename($classFile) . '
' . PHP_EOL; - } // END - foreach - - // And return it - return $includeList; - } - }