]> source.dussan.org Git - nextcloud-server.git/commitdiff
initialize all storage backends when searching for a file, fixed searching in the...
authorRobin Appelman <icewind@owncloud.com>
Thu, 26 Jan 2012 16:56:13 +0000 (17:56 +0100)
committerRobin Appelman <icewind@owncloud.com>
Thu, 26 Jan 2012 16:56:13 +0000 (17:56 +0100)
lib/filesystem.php

index fd0ac3b621575063d96bf38a0306cd3a1e3dcc74..bd953deb2107dc3188aeb0cfb12f0b6e8a521ac8 100644 (file)
@@ -226,6 +226,17 @@ class OC_Filesystem{
                }
                self::$mounts[$mountpoint]=array('type'=>$type,'arguments'=>$arguments);
        }
+
+       /**
+        * create all storage backends mounted in the filesystem
+        */
+       static private function mountAll(){
+               foreach(self::$mounts as $mountPoint=>$mount){
+                       if(!isset(self::$storages[$mountPoint])){
+                               self::$storages[$mountPoint]=self::createStorage($mount['type'],$mount['arguments']);
+                       }
+               }
+       }
        
        /**
        * get the storage object for a path
@@ -501,6 +512,7 @@ class OC_Filesystem{
        }
        
        static public function search($query){
+               self::mountAll();
                $files=array();
                $fakeRoot=self::$fakeRoot;
                $fakeRootLength=strlen($fakeRoot);