]> source.dussan.org Git - nextcloud-server.git/commitdiff
removeStorageWrapper to unregister a storage wrapper
authorVincent Petry <pvince81@owncloud.com>
Wed, 21 Jan 2015 20:54:43 +0000 (21:54 +0100)
committerVincent Petry <pvince81@owncloud.com>
Fri, 23 Jan 2015 11:20:54 +0000 (12:20 +0100)
lib/private/files/filesystem.php
lib/private/files/storage/storagefactory.php

index 0a0c5c3612a0a6e40b5455cfcd9a370806b783fa..5fa3428643e43822cedd37805568c77610e3e983 100644 (file)
@@ -186,6 +186,11 @@ class Filesystem {
                }
        }
 
+       /**
+        * Returns the storage factory
+        *
+        * @return \OCP\Files\Storage\IStorageFactory
+        */
        public static function getLoader() {
                if (!self::$loader) {
                        self::$loader = new StorageFactory();
@@ -193,6 +198,11 @@ class Filesystem {
                return self::$loader;
        }
 
+       /**
+        * Returns the mount manager
+        *
+        * @return \OC\Files\Filesystem\Mount\Manager
+        */
        public static function getMountManager() {
                if (!self::$mounts) {
                        \OC_Util::setupFS();
index 9c1c7325b76e025ecaf7c72295ec24e4cb2e9106..6fa360fa84c04599d601da65a597ced73e27da3e 100644 (file)
@@ -21,9 +21,9 @@ class StorageFactory implements IStorageFactory {
         *
         * $callback should be a function of type (string $mountPoint, Storage $storage) => Storage
         *
-        * @param string $wrapperName
-        * @param callable $callback
-        * @return true if the wrapper was added, false if there was already a wrapper with this
+        * @param string $wrapperName name of the wrapper
+        * @param callable $callback callback
+        * @return bool true if the wrapper was added, false if there was already a wrapper with this
         * name registered
         */
        public function addStorageWrapper($wrapperName, $callback) {
@@ -34,6 +34,17 @@ class StorageFactory implements IStorageFactory {
                return true;
        }
 
+       /**
+        * Remove a storage wrapper by name.
+        * Note: internal method only to be used for cleanup
+        *
+        * @param string $wrapperName name of the wrapper
+        * @internal
+        */
+       public function removeStorageWrapper($wrapperName) {
+               unset($this->storageWrappers[$wrapperName]);
+       }
+
        /**
         * Create an instance of a storage and apply the registered storage wrappers
         *