diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-06-12 17:23:34 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2014-06-14 10:14:08 +0200 |
commit | 87e311b99628858ddb974cd35ae381a26b4bcdb5 (patch) | |
tree | 35b26ad637c6dbff04f35c188ccfd4cf0b5e7711 /lib/private/files/storage/common.php | |
parent | decb51aee64d024059cf9f66b88e802270f8da09 (diff) | |
download | nextcloud-server-87e311b99628858ddb974cd35ae381a26b4bcdb5.tar.gz nextcloud-server-87e311b99628858ddb974cd35ae381a26b4bcdb5.zip |
Fix storage being passed to cache/watcher and scanner when using storage wrappers
Diffstat (limited to 'lib/private/files/storage/common.php')
-rw-r--r-- | lib/private/files/storage/common.php | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php index 4d5a2078ef7..ecc75298b66 100644 --- a/lib/private/files/storage/common.php +++ b/lib/private/files/storage/common.php @@ -287,31 +287,43 @@ abstract class Common implements \OC\Files\Storage\Storage { return $this->filemtime($path) > $time; } - public function getCache($path = '') { + public function getCache($path = '', $storage = null) { + if (!$storage) { + $storage = $this; + } if (!isset($this->cache)) { - $this->cache = new \OC\Files\Cache\Cache($this); + $this->cache = new \OC\Files\Cache\Cache($storage); } return $this->cache; } - public function getScanner($path = '') { + public function getScanner($path = '', $storage = null) { + if (!$storage) { + $storage = $this; + } if (!isset($this->scanner)) { - $this->scanner = new \OC\Files\Cache\Scanner($this); + $this->scanner = new \OC\Files\Cache\Scanner($storage); } return $this->scanner; } - public function getWatcher($path = '') { + public function getWatcher($path = '', $storage = null) { + if (!$storage) { + $storage = $this; + } if (!isset($this->watcher)) { - $this->watcher = new \OC\Files\Cache\Watcher($this); + $this->watcher = new \OC\Files\Cache\Watcher($storage); $this->watcher->setPolicy(\OC::$server->getConfig()->getSystemValue('filesystem_check_changes', Watcher::CHECK_ONCE)); } return $this->watcher; } - public function getStorageCache() { + public function getStorageCache($storage = null) { + if (!$storage) { + $storage = $this; + } if (!isset($this->storageCache)) { - $this->storageCache = new \OC\Files\Cache\Storage($this); + $this->storageCache = new \OC\Files\Cache\Storage($storage); } return $this->storageCache; } |