Fixed calling ObjectFactory::createObjectByConfiguredName() as 2nd parameter must...
[core.git] / inc / classes / main / file_stack / class_BaseFileStack.php
index 724f3c75bb2604ff8b636ddcbb7e675240256cc2..d53d1e3b1bb84b3e61e8c00a1e2f5d28f6033968 100644 (file)
@@ -41,10 +41,16 @@ class BaseFileStack extends BaseFrameworkSystem {
         */
        protected function initStack ($fileName) {
                // Get a file i/o pointer instance
-               $pointerInstance = ObjectFactory::createObjectByConfiguredName('file_raw_input_output_class'
+               $pointerInstance = ObjectFactory::createObjectByConfiguredName('file_raw_input_output_class', array($fileName));
 
-               // And set it here
-               $this->setPointerInstance($pointerInstance);
+               // Get iterator instance
+               $iteratorInstance = ObjectFactory::createObjectByConfiguredName('file_io_iterator_class', array($pointerInstance));
+
+               // Is the instance implementing the right interface?
+               assert($iteratorInstance instanceof SeekableFileIterator);
+
+               // Set iterator here
+               $this->setIteratorInstance($iteratorInstance);
        }
 }