summaryrefslogtreecommitdiffstats
path: root/lib/private/files/filesystem.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/files/filesystem.php')
-rw-r--r--lib/private/files/filesystem.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/private/files/filesystem.php b/lib/private/files/filesystem.php
index f90b2738d03..c460159ece3 100644
--- a/lib/private/files/filesystem.php
+++ b/lib/private/files/filesystem.php
@@ -175,14 +175,18 @@ class Filesystem {
* @param callable $wrapper
*/
public static function addStorageWrapper($wrapperName, $wrapper) {
- self::getLoader()->addStorageWrapper($wrapperName, $wrapper);
-
$mounts = self::getMountManager()->getAll();
- foreach ($mounts as $mount) {
- $mount->wrapStorage($wrapper);
+ if (!self::getLoader()->addStorageWrapper($wrapperName, $wrapper, $mounts)) {
+ // do not re-wrap if storage with this name already existed
+ return;
}
}
+ /**
+ * Returns the storage factory
+ *
+ * @return \OCP\Files\Storage\IStorageFactory
+ */
public static function getLoader() {
if (!self::$loader) {
self::$loader = new StorageFactory();
@@ -190,6 +194,11 @@ class Filesystem {
return self::$loader;
}
+ /**
+ * Returns the mount manager
+ *
+ * @return \OC\Files\Mount\Manager
+ */
public static function getMountManager() {
if (!self::$mounts) {
\OC_Util::setupFS();