From 0735270d8ac6df97d516c397b220a4e4d0b8ec3b Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 23 Jun 2014 20:15:05 +0200 Subject: [PATCH] These constants have moved ... ;-) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- inc/classes/main/index/class_BaseIndex.php | 14 +++++++------- .../main/stacker/file/class_BaseFileStack.php | 18 +++++++++--------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/inc/classes/main/index/class_BaseIndex.php b/inc/classes/main/index/class_BaseIndex.php index beda05c3..632e444c 100644 --- a/inc/classes/main/index/class_BaseIndex.php +++ b/inc/classes/main/index/class_BaseIndex.php @@ -59,7 +59,7 @@ class BaseIndex extends BaseFrameworkSystem { // Last character must be the separator //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] data(-1)=%s', __METHOD__, __LINE__, dechex(ord(substr($data, -1, 1))))); - assert(substr($data, -1, 1) == chr(BaseFile::SEPARATOR_HEADER_ENTRIES)); + assert(substr($data, -1, 1) == chr(BaseBinaryFile::SEPARATOR_HEADER_ENTRIES)); //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); // Okay, then remove it @@ -74,7 +74,7 @@ class BaseIndex extends BaseFrameworkSystem { * 0 => magic * 1 => total entries */ - $header = explode(chr(BaseFile::SEPARATOR_HEADER_DATA), $data); + $header = explode(chr(BaseBinaryFile::SEPARATOR_HEADER_DATA), $data); // Set it here $this->getIteratorInstance()->setHeader($header); @@ -112,13 +112,13 @@ class BaseIndex extends BaseFrameworkSystem { self::INDEX_MAGIC, // Separator header data - chr(BaseFile::SEPARATOR_HEADER_DATA), + chr(BaseBinaryFile::SEPARATOR_HEADER_DATA), // Total entries str_pad($this->dec2hex($this->getIteratorInstance()->getCounter()), BaseFile::LENGTH_COUNT, '0', STR_PAD_LEFT), // Separator header<->entries - chr(BaseFile::SEPARATOR_HEADER_ENTRIES) + chr(BaseBinaryFile::SEPARATOR_HEADER_ENTRIES) ); // Write it to disk (header is always at seek position 0) @@ -153,9 +153,9 @@ class BaseIndex extends BaseFrameworkSystem { // Calculate header size $this->getIteratorInstance()->setHeaderSize( strlen(self::INDEX_MAGIC) + - strlen(chr(BaseFile::SEPARATOR_HEADER_DATA)) + + strlen(chr(BaseBinaryFile::SEPARATOR_HEADER_DATA)) + BaseFile::LENGTH_COUNT + - strlen(chr(BaseFile::SEPARATOR_HEADER_ENTRIES)) + strlen(chr(BaseBinaryFile::SEPARATOR_HEADER_ENTRIES)) ); // Init counters and gaps array @@ -184,7 +184,7 @@ class BaseIndex extends BaseFrameworkSystem { */ public function calculateMinimumBlockLength () { // Calulcate it - $length = BaseFile::LENGTH_TYPE + strlen(chr(BaseFile::SEPARATOR_TYPE_POSITION)) + BaseFile::LENGTH_POSITION + strlen(chr(BaseFile::SEPARATOR_ENTRIES)); + $length = BaseFile::LENGTH_TYPE + strlen(chr(BaseBinaryFile::SEPARATOR_TYPE_POSITION)) + BaseFile::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 a07d5034..7effdde4 100644 --- a/inc/classes/main/stacker/file/class_BaseFileStack.php +++ b/inc/classes/main/stacker/file/class_BaseFileStack.php @@ -60,7 +60,7 @@ class BaseFileStack extends BaseStacker { // Last character must be the separator //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] data(-1)=%s', __METHOD__, __LINE__, dechex(ord(substr($data, -1, 1))))); - assert(substr($data, -1, 1) == chr(BaseFile::SEPARATOR_HEADER_ENTRIES)); + assert(substr($data, -1, 1) == chr(BaseBinaryFile::SEPARATOR_HEADER_ENTRIES)); //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); // Okay, then remove it @@ -76,7 +76,7 @@ class BaseFileStack extends BaseStacker { * 1 => total entries * 2 => current seek position */ - $header = explode(chr(BaseFile::SEPARATOR_HEADER_DATA), $data); + $header = explode(chr(BaseBinaryFile::SEPARATOR_HEADER_DATA), $data); // Set header here $this->getIteratorInstance()->setHeader($header); @@ -117,19 +117,19 @@ class BaseFileStack extends BaseStacker { self::STACK_MAGIC, // Separator magic<->count - chr(BaseFile::SEPARATOR_HEADER_DATA), + 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), // Separator count<->seek position - chr(BaseFile::SEPARATOR_HEADER_DATA), + chr(BaseBinaryFile::SEPARATOR_HEADER_DATA), // Position (will be zero) str_pad($this->dec2hex($this->getSeekPosition(), 2), BaseFile::LENGTH_POSITION, '0', STR_PAD_LEFT), // Separator position<->entries - chr(BaseFile::SEPARATOR_HEADER_ENTRIES) + chr(BaseBinaryFile::SEPARATOR_HEADER_ENTRIES) ); // Write it to disk (header is always at seek position 0) @@ -162,11 +162,11 @@ class BaseFileStack extends BaseStacker { // Calculate header size $this->getIteratorInstance()->setHeaderSize( strlen(self::STACK_MAGIC) + - strlen(chr(BaseFile::SEPARATOR_HEADER_DATA)) + + strlen(chr(BaseBinaryFile::SEPARATOR_HEADER_DATA)) + BaseFile::LENGTH_COUNT + - strlen(chr(BaseFile::SEPARATOR_HEADER_DATA)) + + strlen(chr(BaseBinaryFile::SEPARATOR_HEADER_DATA)) + BaseFile::LENGTH_POSITION + - strlen(chr(BaseFile::SEPARATOR_HEADER_ENTRIES)) + strlen(chr(BaseBinaryFile::SEPARATOR_HEADER_ENTRIES)) ); // Init counters and gaps array @@ -410,7 +410,7 @@ class BaseFileStack extends BaseStacker { */ public function calculateMinimumBlockLength () { // Calulcate it - $length = self::getHashLength() + strlen(chr(BaseFile::SEPARATOR_HASH_NAME)) + BaseFile::LENGTH_NAME + 1 + strlen(chr(BaseFile::SEPARATOR_ENTRIES)); + $length = self::getHashLength() + strlen(chr(BaseBinaryFile::SEPARATOR_HASH_NAME)) + BaseFile::LENGTH_NAME + 1 + strlen(chr(BaseBinaryFile::SEPARATOR_ENTRIES)); // Return it return $length; -- 2.39.5