diff --git a/lib/private/files/filesystem.php b/lib/private/files/filesystem.php index ad7213d23683fbaf126c28935628fd276d7d6c58..2cc4a2130ebb94d56fe4b1318f04d94fc2b87d88 100644 --- a/lib/private/files/filesystem.php +++ b/lib/private/files/filesystem.php @@ -168,8 +168,8 @@ class Filesystem { /** * @param callable $wrapper */ - public static function addStorageWrapper($wrapper) { - self::getLoader()->addStorageWrapper($wrapper); + public static function addStorageWrapper($wrapperName, $wrapper) { + self::getLoader()->addStorageWrapper($wrapperName, $wrapper); $mounts = self::getMountManager()->getAll(); foreach ($mounts as $mount) { diff --git a/lib/private/files/storage/loader.php b/lib/private/files/storage/loader.php index 966234cb04d981eb5b05fc5fd22c24c8be1fb3d6..c75a0a976a705558964ae4833e9bd6c954847bcd 100644 --- a/lib/private/files/storage/loader.php +++ b/lib/private/files/storage/loader.php @@ -21,8 +21,8 @@ class Loader { * * @param callable $callback */ - public function addStorageWrapper($callback) { - $this->storageWrappers[] = $callback; + public function addStorageWrapper($wrapperName, $callback) { + $this->storageWrappers[$wrapperName] = $callback; } /** diff --git a/lib/private/util.php b/lib/private/util.php index 8cc48c0346272a97014ae1e9af8f681b034fc481..da67dbcee545deee1d11fed395e75e60427e65e0 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -53,7 +53,7 @@ class OC_Util { //if we aren't logged in, there is no use to set up the filesystem if( $user != "" ) { - \OC\Files\Filesystem::addStorageWrapper(function($mountPoint, $storage){ + \OC\Files\Filesystem::addStorageWrapper('oc_quota', function($mountPoint, $storage){ // set up quota for home storages, even for other users // which can happen when using sharing @@ -72,7 +72,7 @@ class OC_Util { }); // Set up flock - \OC\Files\Filesystem::addStorageWrapper(function($mountPoint, /** @var \OC\Files\Storage\Storage|null $storage */ $storage){ + \OC\Files\Filesystem::addStorageWrapper('oc_flock', function($mountPoint, /** @var \OC\Files\Storage\Storage|null $storage */ $storage){ // lock files on all local storage if ($storage instanceof \OC\Files\Storage\Storage && $storage->isLocal()) { return new \OC\Files\Storage\Wrapper\LockingWrapper(array('storage' => $storage));