diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2014-06-02 15:06:15 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-06-04 07:55:46 +0200 |
commit | ab6680e9ab4c7ba24bcd47c01b46d2ca8993bc96 (patch) | |
tree | ef6b34276b0b4f0b248b12298dafd1fd6b6134d6 /lib | |
parent | 3a698bce6e7def580eea5773a0b62d0fa25edc5e (diff) | |
download | nextcloud-server-ab6680e9ab4c7ba24bcd47c01b46d2ca8993bc96.tar.gz nextcloud-server-ab6680e9ab4c7ba24bcd47c01b46d2ca8993bc96.zip |
name the storage wrapper to make sure that we don't apply the wrapper multiple times
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/filesystem.php | 4 | ||||
-rw-r--r-- | lib/private/files/storage/loader.php | 4 | ||||
-rwxr-xr-x | lib/private/util.php | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/private/files/filesystem.php b/lib/private/files/filesystem.php index ad7213d2368..2cc4a2130eb 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 966234cb04d..c75a0a976a7 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 8cc48c03462..da67dbcee54 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)); |