From: Roland Haeder Date: Mon, 23 Jun 2014 18:16:33 +0000 (+0200) Subject: Even more ... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f55e9193e00188029b557c1e0eb7e2b3b1a02763;p=core.git Even more ... Signed-off-by: Roland Häder --- diff --git a/inc/classes/main/index/class_BaseIndex.php b/inc/classes/main/index/class_BaseIndex.php index 632e444c..9e001be7 100644 --- a/inc/classes/main/index/class_BaseIndex.php +++ b/inc/classes/main/index/class_BaseIndex.php @@ -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; diff --git a/inc/classes/main/stacker/file/class_BaseFileStack.php b/inc/classes/main/stacker/file/class_BaseFileStack.php index 7effdde4..d225950b 100644 --- a/inc/classes/main/stacker/file/class_BaseFileStack.php +++ b/inc/classes/main/stacker/file/class_BaseFileStack.php @@ -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;