From: Roland Haeder Date: Sat, 17 May 2014 22:00:35 +0000 (+0200) Subject: Added debug lines. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7d76fdb47f1becf4677d0953b8830c0f2a427c5f;p=core.git Added debug lines. Signed-off-by: Roland Häder --- diff --git a/inc/classes/main/file_directories/class_BaseFileIo.php b/inc/classes/main/file_directories/class_BaseFileIo.php index b3b676dd..e4a076f9 100644 --- a/inc/classes/main/file_directories/class_BaseFileIo.php +++ b/inc/classes/main/file_directories/class_BaseFileIo.php @@ -144,6 +144,7 @@ class BaseFileIo extends BaseFrameworkSystem { $status = fseek($this->getPointer(), $offset, $whence); // Return status + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] status=%s', __METHOD__, __LINE__, $status)); return $status; } @@ -153,11 +154,14 @@ class BaseFileIo extends BaseFrameworkSystem { * @return $size Size (in bytes) of file */ public function size () { + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); + // Get current seek position $seekPosition = $this->getSeekPosition(); // Seek to end - $this->seek(0, SEEK_END); + $seekStatus = $this->seek(0, SEEK_END); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] seekStatus=%s', __METHOD__, __LINE__, $seekStatus)); // Get position again (which is the end of the file) $size = $this->getSeekPosition(); @@ -166,6 +170,7 @@ class BaseFileIo extends BaseFrameworkSystem { $this->seek($seekPosition); // Return size + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] size=%s - EXIT!', __METHOD__, __LINE__, $size)); return $size; } } diff --git a/inc/classes/main/stacker/file/class_BaseFileStack.php b/inc/classes/main/stacker/file/class_BaseFileStack.php index 21315929..95fb8c8a 100644 --- a/inc/classes/main/stacker/file/class_BaseFileStack.php +++ b/inc/classes/main/stacker/file/class_BaseFileStack.php @@ -133,19 +133,22 @@ class BaseFileStack extends BaseStacker { * @return $isInitialized Whether the file header is initialized */ private function isFileHeaderInitialized () { + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); // Default is not initialized $isInitialized = FALSE; // Is the file initialized? if ($this->isFileInitialized()) { // Some bytes has been written, so rewind to start of it. - $this->getIteratorInstance()->rewind(); + $rewindStatus = $this->getIteratorInstance()->rewind(); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] rewindStatus=%s', __METHOD__, __LINE__, $rewindStatus)); // Read file header $this->readFileHeader(); } // END - if // Return result + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] isInitialized=%d - EXIT!', __METHOD__, __LINE__, intval($isInitialized))); return $isInitialized; } @@ -157,6 +160,7 @@ class BaseFileStack extends BaseStacker { private function isFileInitialized () { // Get it from iterator which holds the pointer instance. If FALSE is returned $fileSize = $this->getIteratorInstance()->size(); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] fileSize=%s', __METHOD__, __LINE__, $fileSize)); /* * The returned file size should not be FALSE or NULL as this means @@ -168,6 +172,7 @@ class BaseFileStack extends BaseStacker { $isInitialized = ($fileSize > 0); // Return result + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] isInitialized=%d - EXIT!', __METHOD__, __LINE__, intval($isInitialized))); return $isInitialized; }