removeStorageWrapper to unregister a storage wrapper
This commit is contained in:
parent
6fb553e92c
commit
5fb8a4715d
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue