]> git.mxchange.org Git - core.git/commitdiff
These constants have moved ... ;-)
authorRoland Haeder <roland@mxchange.org>
Mon, 23 Jun 2014 18:15:05 +0000 (20:15 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 23 Jun 2014 18:15:05 +0000 (20:15 +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 beda05c372ac306a299b90749905f6722e0ee333..632e444c5315cc54b7eb295656dcadfbbf5c3e0b 100644 (file)
@@ -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;
index a07d503422dc75628716b3879314734952310ca3..7effdde4f06fd916788eb219384ebbe9de1ed79d 100644 (file)
@@ -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;