$this->setHeaderSize(
strlen(self::INDEX_MAGIC) +
strlen(chr(BaseFile::SEPARATOR_HEADER_DATA)) +
- self::LENGTH_COUNT +
+ BaseFile::LENGTH_COUNT +
strlen(chr(BaseFile::SEPARATOR_HEADER_ENTRIES))
);
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__));
// Check length of count
- assert(strlen($header[1]) == self::LENGTH_COUNT);
+ assert(strlen($header[1]) == BaseFile::LENGTH_COUNT);
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__));
// Decode count
chr(BaseFile::SEPARATOR_HEADER_DATA),
// Total entries
- str_pad($this->dec2hex($this->getCounter()), self::LENGTH_COUNT, '0', STR_PAD_LEFT),
+ str_pad($this->dec2hex($this->getCounter()), BaseFile::LENGTH_COUNT, '0', STR_PAD_LEFT),
// Separator header<->entries
chr(BaseFile::SEPARATOR_HEADER_ENTRIES)
*/
public function calculateMinimumBlockLength () {
// Calulcate it
- $length = self::LENGTH_TYPE + strlen(chr(BaseFile::SEPARATOR_TYPE_POSITION)) + self::LENGTH_POSITION + strlen(chr(BaseFile::SEPARATOR_ENTRIES));
+ $length = BaseFile::LENGTH_TYPE + strlen(chr(BaseFile::SEPARATOR_TYPE_POSITION)) + BaseFile::LENGTH_POSITION + strlen(chr(BaseFile::SEPARATOR_ENTRIES));
// Return it
return $length;
$this->setHeaderSize(
strlen(self::STACK_MAGIC) +
strlen(chr(BaseFile::SEPARATOR_HEADER_DATA)) +
- self::LENGTH_COUNT +
+ BaseFile::LENGTH_COUNT +
strlen(chr(BaseFile::SEPARATOR_HEADER_DATA)) +
- self::LENGTH_POSITION +
+ BaseFile::LENGTH_POSITION +
strlen(chr(BaseFile::SEPARATOR_HEADER_ENTRIES))
);
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__));
// Check length of count and seek position
- assert(strlen($header[1]) == self::LENGTH_COUNT);
+ assert(strlen($header[1]) == BaseFile::LENGTH_COUNT);
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__));
- assert(strlen($header[2]) == self::LENGTH_POSITION);
+ assert(strlen($header[2]) == BaseFile::LENGTH_POSITION);
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__));
// Decode count and seek position
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),
+ str_pad($this->dec2hex($this->getCounter()), BaseFile::LENGTH_COUNT, '0', STR_PAD_LEFT),
// Separator count<->seek position
chr(BaseFile::SEPARATOR_HEADER_DATA),
// Position (will be zero)
- str_pad($this->dec2hex($this->getSeekPosition(), 2), self::LENGTH_POSITION, '0', STR_PAD_LEFT),
+ str_pad($this->dec2hex($this->getSeekPosition(), 2), BaseFile::LENGTH_POSITION, '0', STR_PAD_LEFT),
// Separator position<->entries
chr(BaseFile::SEPARATOR_HEADER_ENTRIES)
*/
public function calculateMinimumBlockLength () {
// Calulcate it
- $length = self::getHashLength() + strlen(chr(BaseFile::SEPARATOR_HASH_NAME)) + self::LENGTH_NAME + 1 + strlen(chr(BaseFile::SEPARATOR_ENTRIES));
+ $length = self::getHashLength() + strlen(chr(BaseFile::SEPARATOR_HASH_NAME)) + BaseFile::LENGTH_NAME + 1 + strlen(chr(BaseFile::SEPARATOR_ENTRIES));
// Return it
return $length;