]> git.mxchange.org Git - core.git/commitdiff
Switched from unabstracted file pointer class to a better abstract approach (unfinished).
authorRoland Haeder <roland@mxchange.org>
Tue, 20 May 2014 21:07:52 +0000 (23:07 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 20 May 2014 21:07:52 +0000 (23:07 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
inc/classes/main/index/class_BaseIndex.php
inc/classes/main/stacker/file/class_BaseFileStack.php
inc/config.php

index 748a278a680d37166b41514e8cad9e7b5b414c5c..18b2d69ae3544b9e19804b898e3c4f7c78a9e61b 100644 (file)
@@ -189,16 +189,17 @@ class BaseIndex extends BaseFrameworkSystem {
         *
         * @param       $fileName       File name of this index
         * @return      void
+        * @todo        Currently the index file is not cached, please implement a memory-handling class and if enough RAM is found, cache the whole index file.
         */
        protected function initIndex ($fileName) {
                // Append index file extension
                $fileName .= $this->getConfigInstance()->getConfigEntry('index_extension');
 
                // Get a file i/o pointer instance for index file
-               $pointerInstance = ObjectFactory::createObjectByConfiguredName('file_raw_input_output_class', array($fileName));
+               $fileInstance = ObjectFactory::createObjectByConfiguredName('index_file_class', array($fileName));
 
                // Get iterator instance
-               $iteratorInstance = ObjectFactory::createObjectByConfiguredName('file_io_iterator_class', array($pointerInstance));
+               $iteratorInstance = ObjectFactory::createObjectByConfiguredName('file_io_iterator_class', array($fileInstance));
 
                // Is the instance implementing the right interface?
                assert($iteratorInstance instanceof SeekableWritableFileIterator);
index 9b662aac46381b993ece22b261da677a7004bdca..4729486a5e65a1a749ac2afe0226d369c8affef8 100644 (file)
@@ -198,13 +198,14 @@ class BaseFileStack extends BaseStacker {
         * @param       $fileName       File name of this stack
         * @param       $type           Type of this stack (e.g. url_source for URL sources)
         * @return      void
+        * @todo        Currently the stack file is not cached, please implement a memory-handling class and if enough RAM is found, cache the whole stack file.
         */
        protected function initFileStack ($fileName, $type) {
                // Get a file i/o pointer instance for stack file
-               $pointerInstance = ObjectFactory::createObjectByConfiguredName('file_raw_input_output_class', array($fileName));
+               $fileInstance = ObjectFactory::createObjectByConfiguredName('stack_file_class', array($fileName));
 
                // Get iterator instance
-               $iteratorInstance = ObjectFactory::createObjectByConfiguredName('file_io_iterator_class', array($pointerInstance));
+               $iteratorInstance = ObjectFactory::createObjectByConfiguredName('file_io_iterator_class', array($fileInstance));
 
                // Is the instance implementing the right interface?
                assert($iteratorInstance instanceof SeekableWritableFileIterator);
index cecc855274a471ce41194394083fc6372680fe5c..a51fb8dfce490b89c9ebc439739113319ae31eaa 100644 (file)
@@ -386,5 +386,11 @@ $cfg->setConfigEntry('index_pre_allocate_enabled', 'Y');
 // CFG: INDEX-PRE-ALLOCATE-COUNT
 $cfg->setConfigEntry('index_pre_allocate_count', 10000);
 
+// CFG: STACK-FILE-CLASS
+$cfg->setConfigEntry('stack_file_class', 'StackFile');
+
+// CFG: INDEX-FILE-CLASS
+$cfg->setConfigEntry('index_file_class', 'IndexFile');
+
 // [EOF]
 ?>