X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=framework%2Fmain%2Fclasses%2Ffile_directories%2Fdirectory%2Fclass_FrameworkDirectoryPointer.php;h=4c033024fac389928d9ee40f961e22d9e21ca572;hp=eba7d4233626e2be5688b0a235250d7d14be79dd;hb=b002c5909aa0f781505dde5414964b0f014cde01;hpb=4f9cf34b521892cb99fae9b21b92787f3d555b74 diff --git a/framework/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php b/framework/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php index eba7d423..4c033024 100644 --- a/framework/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php +++ b/framework/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php @@ -133,7 +133,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework * Read lines from the current directory pointer except some parts * * @param $except Some parts of a directory we want to ignore. Valid: directory and file names, other values will be silently ignored - * @return string Directory and/or file names read from the current directory pointer + * @return SplFileInfo An instance of a SplFileInfo class */ public function readDirectoryExcept (array $except = array()) { // No exceptions given? @@ -148,7 +148,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework } // Init raw line - $rawLine = NULL; + $fileInfoInstance = NULL; // Read a raw line... $currentEntry = $this->readRawDirectory(); @@ -157,17 +157,17 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework // Shall we exclude directories? if (is_object($currentEntry)) { // Get file name - $rawLine = $currentEntry->getFilename(); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: rawLine[' . gettype($rawLine) . ']=' . $rawLine . ',isDot=' . intval($this->getDirectoryIteratorInstance()->isDot())); + $fileInfoInstance = $currentEntry; + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: fileInfoInstance[' . gettype($fileInfoInstance) . ']=' . $fileInfoInstance . ',isDot=' . intval($this->getDirectoryIteratorInstance()->isDot())); // Is it a dot-directory or excluded? - if (($this->getDirectoryIteratorInstance()->isDot()) || (in_array($rawLine, $except))) { + if (($this->getDirectoryIteratorInstance()->isDot()) || (in_array($fileInfoInstance, $except))) { // To next entry $this->getDirectoryIteratorInstance()->next(); // Exclude this part - $rawLine = $this->readDirectoryExcept($except); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: rawline[' . gettype($rawLine) . ']=' . $rawLine . ' - Recursive call!'); + $fileInfoInstance = $this->readDirectoryExcept($except); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: fileInfoInstance[' . gettype($fileInfoInstance) . ']=' . $fileInfoInstance . ' - Recursive call!'); } // END - if } // END - if @@ -175,8 +175,8 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework $this->getDirectoryIteratorInstance()->next(); // Return read line - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: rawLine[' . gettype($rawLine) . ']=' . $rawLine); - return $rawLine; + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: fileInfoInstance[' . gettype($fileInfoInstance) . ']=' . $fileInfoInstance); + return $fileInfoInstance; } /**