From: Roland Haeder Date: Sat, 31 May 2014 11:23:17 +0000 (+0200) Subject: Had been moved. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=09e0d01cf5fc1e7ba5bc0c63751ea967bea9b4c9;p=core.git Had been moved. 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 f2eeac33..6dac0124 100644 --- a/inc/classes/main/index/class_BaseIndex.php +++ b/inc/classes/main/index/class_BaseIndex.php @@ -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; diff --git a/inc/classes/main/stacker/file/class_BaseFileStack.php b/inc/classes/main/stacker/file/class_BaseFileStack.php index 572c1bd9..b70d1ded 100644 --- a/inc/classes/main/stacker/file/class_BaseFileStack.php +++ b/inc/classes/main/stacker/file/class_BaseFileStack.php @@ -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;