From 5209cff371c448a5fec75882044b7a8e3ed05f95 Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Thu, 25 Jul 2013 16:01:05 +0200
Subject: [PATCH] add conveince function to wrap all storages

---
 lib/files/filesystem.php | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php
index 4281ebba99..10ec5c41d1 100644
--- a/lib/files/filesystem.php
+++ b/lib/files/filesystem.php
@@ -149,6 +149,18 @@ class Filesystem {
 	 */
 	private static $loader;
 
+	/**
+	 * @param callable $wrapper
+	 */
+	public static function addStorageWrapper($wrapper) {
+		self::getLoader()->addStorageWrapper($wrapper);
+
+		$mounts = self::getMountManager()->getAll();
+		foreach ($mounts as $mount) {
+			$mount->wrapStorage($wrapper);
+		}
+	}
+
 	public static function getLoader() {
 		if (!self::$loader) {
 			self::$loader = new Loader();
-- 
GitLab