Moved analyzeFile() to BaseFile where a much better place is (and duplicate
[core.git] / inc / classes / main / index / class_BaseIndex.php
index de0e5629ab411569ec73b1897d225f32e89919ec..0ee7b77c251cdeb08c49dda69acdf71bee129de5 100644 (file)
@@ -138,43 +138,6 @@ class BaseIndex extends BaseFrameworkSystem {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__));
        }
 
-       /**
-        * Analyzes entries in index file. This will count all found (and valid)
-        * entries, mark invalid as damaged and count gaps ("fragmentation"). If
-        * only gaps are found, the file is considered as "virgin" (no entries).
-        *
-        * @return      void
-        */
-       private function analyzeFile () {
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__));
-
-               // Make sure the file is initialized
-               assert($this->isFileInitialized());
-
-               // Init counters and gaps array
-               $this->initCountersGapsArray();
-
-               // Output message (as this may take some time)
-               self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Analyzing file structure ... (this may take some time)', __METHOD__, __LINE__));
-
-               // First rewind to the begining
-               $this->getIteratorInstance()->rewind();
-
-               // Then try to load all entries
-               while ($this->getIteratorInstance()->valid()) {
-                       // Go to next entry
-                       $this->getIteratorInstance()->next();
-
-                       // Get current entry
-                       $current = $this->getIteratorInstance()->current();
-
-                       // Simply output it
-                       self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] current=%s', __METHOD__, __LINE__, print_r($current, TRUE)));
-               } // END - while
-
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__));
-       }
-
        /**
         * Initializes this index
         *
@@ -211,7 +174,7 @@ class BaseIndex extends BaseFrameworkSystem {
                $this->readFileHeader();
 
                // Count all entries in file
-               $this->analyzeFile();
+               $this->getIteratorInstance()->analyzeFile();
        }
 
        /**