Rewritten:
[core.git] / framework / main / classes / factories / index / class_FileStackIndexFactory.php
index baf1b3892bb983af7c7d9d7bd3747e03d23161ee..53633de87f36e3692007b9962af517f228320976 100644 (file)
@@ -7,6 +7,9 @@ use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Registry\Registry;
 use CoreFramework\Stacker\Index\IndexableStack;
 
+// Import SPL stuff
+use \SplFileInfo;
+
 /**
  * A factory class for file-based stack indexes
  *
@@ -43,17 +46,17 @@ class FileStackIndexFactory extends ObjectFactory {
        /**
         * Returns a singleton (registry-based) StackableFile instance
         *
-        * @param       $stackName                      Name of the stack's file
-        * @return      $indexInstance          An instance of a IndexableStack class
+        * @param       $infoInstance   An instance of a SplFileInfo class
+        * @return      $indexInstance  An instance of a IndexableStack class
         */
-       public static final function createFileStackIndexInstance ($fileName, $type) {
+       public static final function createFileStackIndexInstance (SplFileInfo $infoInstance, $type) {
                // If there is no handler?
                if (Registry::getRegistry()->instanceExists($type . '_index')) {
                        // Get handler from registry
                        $indexInstance = Registry::getRegistry()->getInstance($type . '_index');
                } else {
                        // Get the handler instance
-                       $indexInstance = self::createObjectByConfiguredName($type . '_file_stack_index_class', array($fileName));
+                       $indexInstance = self::createObjectByConfiguredName($type . '_file_stack_index_class', array($infoInstance));
 
                        // Add check for interface
                        assert($indexInstance instanceof IndexableStack);