]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/factories/index/class_FileStackIndexFactory.php
Rewritten:
[core.git] / framework / main / classes / factories / index / class_FileStackIndexFactory.php
index 612bf52be1e36908648bb6857ac4534d194b4d95..53633de87f36e3692007b9962af517f228320976 100644 (file)
@@ -5,6 +5,10 @@ namespace CoreFramework\Factory\Filesystem\Stack;
 // Import framework stuff
 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
@@ -42,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);