]> git.mxchange.org Git - core.git/commitdiff
Had been moved.
authorRoland Haeder <roland@mxchange.org>
Sat, 31 May 2014 11:23:17 +0000 (13:23 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 31 May 2014 11:23:17 +0000 (13:23 +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 f2eeac33b33bdcbc922c506e22abe1368fce7d0c..6dac01246e59109249b568bc239a83604f1cc1a9 100644 (file)
@@ -40,9 +40,9 @@ class BaseIndex extends BaseFrameworkSystem {
                // Calculate header size
                $this->setHeaderSize(
                        strlen(self::INDEX_MAGIC) +
-                       strlen(chr(self::SEPARATOR_HEADER_DATA)) +
+                       strlen(chr(BaseFile::SEPARATOR_HEADER_DATA)) +
                        self::LENGTH_COUNT +
-                       strlen(chr(self::SEPARATOR_HEADER_ENTRIES))
+                       strlen(chr(BaseFile::SEPARATOR_HEADER_ENTRIES))
                );
 
                // Init counters and gaps array
@@ -70,7 +70,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(self::SEPARATOR_HEADER_ENTRIES));
+               assert(substr($data, -1, 1) == chr(BaseFile::SEPARATOR_HEADER_ENTRIES));
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__));
 
                // Okay, then remove it
@@ -85,7 +85,7 @@ class BaseIndex extends BaseFrameworkSystem {
                 * 0 => magic
                 * 1 => total entries
                 */
-               $header = explode(chr(self::SEPARATOR_HEADER_DATA), $data);
+               $header = explode(chr(BaseFile::SEPARATOR_HEADER_DATA), $data);
 
                // Set it here
                $this->setHeader($header);
@@ -123,13 +123,13 @@ class BaseIndex extends BaseFrameworkSystem {
                        self::INDEX_MAGIC,
 
                        // Separator header data
-                       chr(self::SEPARATOR_HEADER_DATA),
+                       chr(BaseFile::SEPARATOR_HEADER_DATA),
 
                        // Total entries
                        str_pad($this->dec2hex($this->getCounter()), self::LENGTH_COUNT, '0', STR_PAD_LEFT),
 
                        // Separator header<->entries
-                       chr(self::SEPARATOR_HEADER_ENTRIES)
+                       chr(BaseFile::SEPARATOR_HEADER_ENTRIES)
                );
 
                // Write it to disk (header is always at seek position 0)
@@ -184,7 +184,7 @@ class BaseIndex extends BaseFrameworkSystem {
         */
        public function calculateMinimumBlockLength () {
                // Calulcate it
-               $length = self::LENGTH_TYPE + strlen(chr(self::SEPARATOR_TYPE_POSITION)) + self::LENGTH_POSITION + strlen(chr(self::SEPARATOR_ENTRIES));
+               $length = self::LENGTH_TYPE + strlen(chr(BaseFile::SEPARATOR_TYPE_POSITION)) + self::LENGTH_POSITION + strlen(chr(BaseFile::SEPARATOR_ENTRIES));
 
                // Return it
                return $length;
index 572c1bd9ba7e7286e461b12479cdd6bcba262b41..b70d1ded3206135379420145f74067098a769f9e 100644 (file)
@@ -40,11 +40,11 @@ class BaseFileStack extends BaseStacker {
                // Calculate header size
                $this->setHeaderSize(
                        strlen(self::STACK_MAGIC) +
-                       strlen(chr(self::SEPARATOR_HEADER_DATA)) +
+                       strlen(chr(BaseFile::SEPARATOR_HEADER_DATA)) +
                        self::LENGTH_COUNT +
-                       strlen(chr(self::SEPARATOR_HEADER_DATA)) +
+                       strlen(chr(BaseFile::SEPARATOR_HEADER_DATA)) +
                        self::LENGTH_POSITION +
-                       strlen(chr(self::SEPARATOR_HEADER_ENTRIES))
+                       strlen(chr(BaseFile::SEPARATOR_HEADER_ENTRIES))
                );
 
                // Init counters and gaps array
@@ -73,7 +73,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(self::SEPARATOR_HEADER_ENTRIES));
+               assert(substr($data, -1, 1) == chr(BaseFile::SEPARATOR_HEADER_ENTRIES));
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__));
 
                // Okay, then remove it
@@ -89,7 +89,7 @@ class BaseFileStack extends BaseStacker {
                 * 1 => total entries
                 * 2 => current seek position
                 */
-               $header = explode(chr(self::SEPARATOR_HEADER_DATA), $data);
+               $header = explode(chr(BaseFile::SEPARATOR_HEADER_DATA), $data);
 
                // Set header here
                $this->setHeader($header);
@@ -130,19 +130,19 @@ class BaseFileStack extends BaseStacker {
                        self::STACK_MAGIC,
 
                        // Separator magic<->count
-                       chr(self::SEPARATOR_HEADER_DATA),
+                       chr(BaseFile::SEPARATOR_HEADER_DATA),
 
                        // Total entries (will be zero) and pad it to 20 chars
                        str_pad($this->dec2hex($this->getCounter()), self::LENGTH_COUNT, '0', STR_PAD_LEFT),
 
                        // Separator count<->seek position
-                       chr(self::SEPARATOR_HEADER_DATA),
+                       chr(BaseFile::SEPARATOR_HEADER_DATA),
 
                        // Position (will be zero)
                        str_pad($this->dec2hex($this->getSeekPosition(), 2), self::LENGTH_POSITION, '0', STR_PAD_LEFT),
 
                        // Separator position<->entries
-                       chr(self::SEPARATOR_HEADER_ENTRIES)
+                       chr(BaseFile::SEPARATOR_HEADER_ENTRIES)
                );
 
                // Write it to disk (header is always at seek position 0)
@@ -410,7 +410,7 @@ class BaseFileStack extends BaseStacker {
         */
        public function calculateMinimumBlockLength () {
                // Calulcate it
-               $length = self::getHashLength() + strlen(chr(self::SEPARATOR_HASH_NAME)) + self::LENGTH_NAME + 1 + strlen(chr(self::SEPARATOR_ENTRIES));
+               $length = self::getHashLength() + strlen(chr(BaseFile::SEPARATOR_HASH_NAME)) + self::LENGTH_NAME + 1 + strlen(chr(BaseFile::SEPARATOR_ENTRIES));
 
                // Return it
                return $length;