]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/file_directories/binary/index/class_IndexFile.php
Continued:
[core.git] / framework / main / classes / file_directories / binary / index / class_IndexFile.php
index 35fc1e13695cd85af7069a1c866a511e2be61969..cca972d1899cdbb3a7f650969d259ece9b499fc8 100644 (file)
@@ -52,15 +52,20 @@ class IndexFile extends BaseBinaryFile implements Block {
         */
        public final static function createIndexFile (SplFileInfo $fileInfoInstance, Block $blockInstance) {
                // Get a new instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: fileInfoInstance=%s,blockInstance=%s - CALLED!', $fileInfoInstance, $blockInstance->__toString()));
                $fileInstance = new IndexFile();
 
                // Set block instance here for callbacks
                $fileInstance->setBlockInstance($blockInstance);
 
+               // Expand file name with .idx
+               $indexInfoInstance = new SplFileInfo(sprintf('%s.idx', $fileInfoInstance->__toString()));
+
                // Init this abstract file
-               $fileInstance->initFile($fileInfoInstance);
+               $fileInstance->initFile($indexInfoInstance);
 
                // Return the prepared instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: fileInstance=%s - EXIT!', $fileInstance->__toString()));
                return $fileInstance;
        }
 
@@ -72,7 +77,7 @@ class IndexFile extends BaseBinaryFile implements Block {
         * @return      $data           Hash and gap position
         * @throws      UnsupportedOperationException   If this method is called
         */
-       public function writeValueToFile ($groupId, $value) {
+       public function writeValueToFile (string $groupId, $value) {
                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',value[' . gettype($value) . ']=' . print_r($value, true));
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
@@ -86,7 +91,7 @@ class IndexFile extends BaseBinaryFile implements Block {
         * @return      $data           Gap position and length of the raw data
         * @throws      UnsupportedOperationException   If this method is called
         */
-       public function writeDataToFreeGap ($groupId, $hash, $encoded) {
+       public function writeDataToFreeGap (string $groupId, string $hash, string $encoded) {
                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',encoded()=' . strlen($encoded));
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }