X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fmain%2Fclasses%2Findex%2Ffile_stack%2Fclass_FileStackIndex.php;h=b1e04a96802caba90351158f71142e837b793eab;hb=de1f271c2bdb43725f6671ea6588a44cf33bf091;hp=f5a4585de677f9bdf9ec87d960a1eb9b4b67ac49;hpb=751f9e6c51f00dba27757b72fc85490e51fd3797;p=core.git diff --git a/inc/main/classes/index/file_stack/class_FileStackIndex.php b/inc/main/classes/index/file_stack/class_FileStackIndex.php index f5a4585d..b1e04a96 100644 --- a/inc/main/classes/index/file_stack/class_FileStackIndex.php +++ b/inc/main/classes/index/file_stack/class_FileStackIndex.php @@ -1,10 +1,16 @@ * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * @@ -58,7 +64,7 @@ class FileStackIndex extends BaseIndex implements IndexableStack, Registerable { */ public function addHashToIndex ($groupId, array $data) { // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,gap=%d,length=%d - CALLED!', __METHOD__, __LINE__, $groupId, $data[BaseFileStack::ARRAY_INDEX_HASH], $data[BaseFileStack::ARRAY_INDEX_GAP_POSITION], $data[BaseFileStack::ARRAY_INDEX_DATA_LENGTH])); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,gap=%d,length=%d - CALLED!', __METHOD__, __LINE__, $groupId, $data[BaseFileStack::ARRAY_INDEX_HASH], $data[BaseFileStack::ARRAY_INDEX_GAP_POSITION], $data[BaseFileStack::ARRAY_INDEX_DATA_LENGTH])); // Raw data been written to the file $rawData = sprintf('%s%s%s%s%s%s%s', @@ -72,7 +78,7 @@ class FileStackIndex extends BaseIndex implements IndexableStack, Registerable { ); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,rawData()=%d', __METHOD__, __LINE__, $groupId, $data[BaseFileStack::ARRAY_INDEX_HASH], strlen($rawData))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,rawData()=%d', __METHOD__, __LINE__, $groupId, $data[BaseFileStack::ARRAY_INDEX_HASH], strlen($rawData))); // Search for next free gap $gapPosition = $this->getIteratorInstance()->searchNextGap(strlen($rawData)); @@ -81,13 +87,13 @@ class FileStackIndex extends BaseIndex implements IndexableStack, Registerable { assert($gapPosition > $this->getIteratorInstance()->getHeaderSize()); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,gapPosition=%s', __METHOD__, __LINE__, $groupId, $data[BaseFileStack::ARRAY_INDEX_HASH], $gapPosition)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,gapPosition=%s', __METHOD__, __LINE__, $groupId, $data[BaseFileStack::ARRAY_INDEX_HASH], $gapPosition)); // Then write the data at that gap $this->getIteratorInstance()->writeData($gapPosition, $rawData); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,rawData()=%d - EXIT!', __METHOD__, __LINE__, $groupId, $data[BaseFileStack::ARRAY_INDEX_HASH], strlen($rawData))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,rawData()=%d - EXIT!', __METHOD__, __LINE__, $groupId, $data[BaseFileStack::ARRAY_INDEX_HASH], strlen($rawData))); } /** @@ -100,7 +106,5 @@ class FileStackIndex extends BaseIndex implements IndexableStack, Registerable { public function searchNextGap ($length) { $this->partialStub('length=' . $length); } -} -// [EOF] -?> +}