name the storage wrapper to make sure that we don't apply the wrapper multiple times

This commit is contained in:
Bjoern Schiessle 2014-06-02 15:06:15 +02:00 committed by Thomas Müller
parent 3a698bce6e
commit ab6680e9ab
3 changed files with 6 additions and 6 deletions

View File

@ -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) {

View File

@ -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;
}
/**

View File

@ -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));