X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fio%2Fclass_FrameworkDirectoryPointer.php;h=b8cb9dfbf5ad2f75d0363f19bbbbcf8680e9dd38;hb=546959d365de1c4a499502b4d2f08ce06be69269;hp=253463cf30ec9bdfb8c810373c616cc6b0e69ef4;hpb=70cb8ef9a893f8676290c77b0b83d53363b6914c;p=core.git diff --git a/inc/classes/main/io/class_FrameworkDirectoryPointer.php b/inc/classes/main/io/class_FrameworkDirectoryPointer.php index 253463cf..b8cb9dfb 100644 --- a/inc/classes/main/io/class_FrameworkDirectoryPointer.php +++ b/inc/classes/main/io/class_FrameworkDirectoryPointer.php @@ -2,11 +2,11 @@ /** * A class for directory reading and getting its contents * - * @author Roland Haeder + * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2013 Core Developer Team * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org + * @link http://www.shipsimu.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 @@ -67,21 +67,21 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem { * @throws PathReadProtectedException If the provided path name is read-protected * @throws DirPointerNotOpenedException If opendir() returns not a directory resource */ - public static final function createFrameworkDirectoryPointer ($pathName, $inConstructor = false) { + public static final function createFrameworkDirectoryPointer ($pathName, $inConstructor = FALSE) { // Some pre-sanity checks... if (is_null($pathName)) { // No pathname given if ($inConstructor) { return NULL; } else { - throw new PathIsEmptyException(null, self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new PathIsEmptyException(NULL, self::EXCEPTION_UNEXPECTED_EMPTY_STRING); } } elseif (!is_string($pathName)) { // Is not a string if ($inConstructor) { return NULL; } else { - throw new InvalidPathStringException(null, self::EXCEPTION_INVALID_STRING); + throw new InvalidPathStringException(NULL, self::EXCEPTION_INVALID_STRING); } } elseif (!is_dir($pathName)) { // Not a directory @@ -140,7 +140,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem { public function readDirectoryExcept (array $except = array('.', '..')) { if (count($except) == 0) { // No exception given, so read all data - $this->debugOutput('DIRECTORY: No exceptions given, please use readRawDirectory() instead!'); + self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY[' . __LINE__ . ']: No exceptions given, please use readRawDirectory() instead!'); return $this->readRawDirectory(); } // END - if @@ -148,18 +148,18 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem { $rawLine = $this->readRawDirectory(); // Shall we exclude directories? - if ((!is_null($rawLine)) && ($rawLine !== false) && (!in_array($rawLine, $except))) { + if ((!is_null($rawLine)) && ($rawLine !== FALSE) && (!in_array($rawLine, $except))) { // Return read data - /* NOISY-DEBUG: */ $this->debugOutput('DIRECTORY: rawLine[' . gettype($rawLine) . ']=' . $rawLine); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY[' . __LINE__ . ']: rawLine[' . gettype($rawLine) . ']=' . $rawLine); return $rawLine; - } elseif ((!is_null($rawLine)) && ($rawLine !== false)) { + } elseif ((!is_null($rawLine)) && ($rawLine !== FALSE)) { // Exclude this part - /* NOISY-DEBUG: */ $this->debugOutput('DIRECTORY: rawline[' . gettype($rawLine) . ']=' . $rawLine . ' - Recursive call!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY[' . __LINE__ . ']: rawline[' . gettype($rawLine) . ']=' . $rawLine . ' - Recursive call!'); return $this->readDirectoryExcept($except); } // End pointer reached - /* NOISY-DEBUG: */ $this->debugOutput('DIRECTORY: Returning NULL!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY[' . __LINE__ . ']: Returning NULL!'); return NULL; }