From 3e0abb7c375c43a11c1f2c790353f144dc7ca432 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sat, 24 May 2014 01:43:17 +0200 Subject: [PATCH] Added assert() + noisy debug line + fixed double-implementation of an interface. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- inc/classes/main/index/file_stack/class_FileStackIndex.php | 2 +- inc/classes/main/iterator/io/class_FileIoIterator.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/inc/classes/main/index/file_stack/class_FileStackIndex.php b/inc/classes/main/index/file_stack/class_FileStackIndex.php index ebd5fe25..3df30f84 100644 --- a/inc/classes/main/index/file_stack/class_FileStackIndex.php +++ b/inc/classes/main/index/file_stack/class_FileStackIndex.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class FileStackIndex extends BaseIndex implements IndexableStack, CalculatableBlock, Registerable { +class FileStackIndex extends BaseIndex implements IndexableStack, Registerable { /** * Protected constructor * diff --git a/inc/classes/main/iterator/io/class_FileIoIterator.php b/inc/classes/main/iterator/io/class_FileIoIterator.php index 9ef4801d..ba1019ab 100644 --- a/inc/classes/main/iterator/io/class_FileIoIterator.php +++ b/inc/classes/main/iterator/io/class_FileIoIterator.php @@ -150,7 +150,7 @@ class FileIoIterator extends BaseIterator implements SeekableWritableFileIterato // Wait until a entry/block separator has been found $data = $this->getBackBuffer(); - while (($this->getPointerInstance()->isEndOfFileReached()) && (!$this->getBlockInstance()->isBlockSeparatorFound($data))) { + while ((!$this->getPointerInstance()->isEndOfFileReached()) && (!$this->getBlockInstance()->isBlockSeparatorFound($data))) { // Then read the block $data .= $this->read($length); /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('data()=' . strlen($data)); @@ -159,6 +159,7 @@ class FileIoIterator extends BaseIterator implements SeekableWritableFileIterato // EOF reached? if ($this->getPointerInstance()->isEndOfFileReached()) { // Then abort here silently + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('EOF reached.'); return; } // END - if @@ -171,6 +172,10 @@ class FileIoIterator extends BaseIterator implements SeekableWritableFileIterato // Separate data $dataArray = explode(self::getBlockSeparator(), $data); + // This array must contain two elements + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('dataArray=' . print_r($dataArray, TRUE)); + assert(count($dataArray) == 2); + // Left part is the actual block, right one the back-buffer data $this->setCurrentBlock($dataArray[0]); $this->setBackBuffer($dataArray[1]); -- 2.39.5