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

remotes/origin/ldap_group_count
Bjoern Schiessle 12 years ago committed by Thomas Müller
parent 3a698bce6e
commit ab6680e9ab
  1. 4
      lib/private/files/filesystem.php
  2. 4
      lib/private/files/storage/loader.php
  3. 4
      lib/private/util.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) {

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

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

Loading…
Cancel
Save