Added debug lines.
authorRoland Haeder <roland@mxchange.org>
Sat, 17 May 2014 22:00:35 +0000 (00:00 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 17 May 2014 22:00:35 +0000 (00:00 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
inc/classes/main/file_directories/class_BaseFileIo.php
inc/classes/main/stacker/file/class_BaseFileStack.php

index b3b676dd99527ed16b7e8ecb79d5cac675c338b2..e4a076f96da232abab428b60205609893ceb207e 100644 (file)
@@ -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;
        }
 }
index 21315929272717a46af5bb5dae3c5a56e0b1feb8..95fb8c8af34a3a42479413043cfcf52282743d17 100644 (file)
@@ -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;
        }