]> git.mxchange.org Git - core.git/commitdiff
Even more ...
authorRoland Haeder <roland@mxchange.org>
Mon, 23 Jun 2014 18:16:33 +0000 (20:16 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 23 Jun 2014 18:16:33 +0000 (20:16 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
inc/classes/main/index/class_BaseIndex.php
inc/classes/main/stacker/file/class_BaseFileStack.php

index 632e444c5315cc54b7eb295656dcadfbbf5c3e0b..9e001be7706178967f2e726178c5d88441ed1baf 100644 (file)
@@ -89,7 +89,7 @@ class BaseIndex extends BaseFrameworkSystem {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__));
 
                // Check length of count
-               assert(strlen($header[1]) == BaseFile::LENGTH_COUNT);
+               assert(strlen($header[1]) == BaseBinaryFile::LENGTH_COUNT);
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__));
 
                // Decode count
@@ -115,7 +115,7 @@ class BaseIndex extends BaseFrameworkSystem {
                        chr(BaseBinaryFile::SEPARATOR_HEADER_DATA),
 
                        // Total entries
-                       str_pad($this->dec2hex($this->getIteratorInstance()->getCounter()), BaseFile::LENGTH_COUNT, '0', STR_PAD_LEFT),
+                       str_pad($this->dec2hex($this->getIteratorInstance()->getCounter()), BaseBinaryFile::LENGTH_COUNT, '0', STR_PAD_LEFT),
 
                        // Separator header<->entries
                        chr(BaseBinaryFile::SEPARATOR_HEADER_ENTRIES)
@@ -154,7 +154,7 @@ class BaseIndex extends BaseFrameworkSystem {
                $this->getIteratorInstance()->setHeaderSize(
                        strlen(self::INDEX_MAGIC) +
                        strlen(chr(BaseBinaryFile::SEPARATOR_HEADER_DATA)) +
-                       BaseFile::LENGTH_COUNT +
+                       BaseBinaryFile::LENGTH_COUNT +
                        strlen(chr(BaseBinaryFile::SEPARATOR_HEADER_ENTRIES))
                );
 
@@ -184,7 +184,7 @@ class BaseIndex extends BaseFrameworkSystem {
         */
        public function calculateMinimumBlockLength () {
                // Calulcate it
-               $length = BaseFile::LENGTH_TYPE + strlen(chr(BaseBinaryFile::SEPARATOR_TYPE_POSITION)) + BaseFile::LENGTH_POSITION + strlen(chr(BaseBinaryFile::SEPARATOR_ENTRIES));
+               $length = BaseBinaryFile::LENGTH_TYPE + strlen(chr(BaseBinaryFile::SEPARATOR_TYPE_POSITION)) + BaseBinaryFile::LENGTH_POSITION + strlen(chr(BaseBinaryFile::SEPARATOR_ENTRIES));
 
                // Return it
                return $length;
index 7effdde4f06fd916788eb219384ebbe9de1ed79d..d225950b0b2464186a9b7fad5cff6e3def9c6c35 100644 (file)
@@ -91,9 +91,9 @@ class BaseFileStack extends BaseStacker {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__));
 
                // Check length of count and seek position
-               assert(strlen($header[1]) == BaseFile::LENGTH_COUNT);
+               assert(strlen($header[1]) == BaseBinaryFile::LENGTH_COUNT);
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__));
-               assert(strlen($header[2]) == BaseFile::LENGTH_POSITION);
+               assert(strlen($header[2]) == BaseBinaryFile::LENGTH_POSITION);
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__));
 
                // Decode count and seek position
@@ -120,13 +120,13 @@ class BaseFileStack extends BaseStacker {
                        chr(BaseBinaryFile::SEPARATOR_HEADER_DATA),
 
                        // Total entries (will be zero) and pad it to 20 chars
-                       str_pad($this->dec2hex($this->getIteratorInstance()->getCounter()), BaseFile::LENGTH_COUNT, '0', STR_PAD_LEFT),
+                       str_pad($this->dec2hex($this->getIteratorInstance()->getCounter()), BaseBinaryFile::LENGTH_COUNT, '0', STR_PAD_LEFT),
 
                        // Separator count<->seek position
                        chr(BaseBinaryFile::SEPARATOR_HEADER_DATA),
 
                        // Position (will be zero)
-                       str_pad($this->dec2hex($this->getSeekPosition(), 2), BaseFile::LENGTH_POSITION, '0', STR_PAD_LEFT),
+                       str_pad($this->dec2hex($this->getSeekPosition(), 2), BaseBinaryFile::LENGTH_POSITION, '0', STR_PAD_LEFT),
 
                        // Separator position<->entries
                        chr(BaseBinaryFile::SEPARATOR_HEADER_ENTRIES)
@@ -163,9 +163,9 @@ class BaseFileStack extends BaseStacker {
                $this->getIteratorInstance()->setHeaderSize(
                        strlen(self::STACK_MAGIC) +
                        strlen(chr(BaseBinaryFile::SEPARATOR_HEADER_DATA)) +
-                       BaseFile::LENGTH_COUNT +
+                       BaseBinaryFile::LENGTH_COUNT +
                        strlen(chr(BaseBinaryFile::SEPARATOR_HEADER_DATA)) +
-                       BaseFile::LENGTH_POSITION +
+                       BaseBinaryFile::LENGTH_POSITION +
                        strlen(chr(BaseBinaryFile::SEPARATOR_HEADER_ENTRIES))
                );
 
@@ -410,7 +410,7 @@ class BaseFileStack extends BaseStacker {
         */
        public function calculateMinimumBlockLength () {
                // Calulcate it
-               $length = self::getHashLength() + strlen(chr(BaseBinaryFile::SEPARATOR_HASH_NAME)) + BaseFile::LENGTH_NAME + 1 + strlen(chr(BaseBinaryFile::SEPARATOR_ENTRIES));
+               $length = self::getHashLength() + strlen(chr(BaseBinaryFile::SEPARATOR_HASH_NAME)) + BaseBinaryFile::LENGTH_NAME + 1 + strlen(chr(BaseBinaryFile::SEPARATOR_ENTRIES));
 
                // Return it
                return $length;