summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2013-04-10 08:09:09 -0700
committerJörn Friedrich Dreyer <jfd@butonic.de>2013-04-10 08:09:09 -0700
commit121c8bd3030a8a16a100e3630b908b9bd9f8abbf (patch)
tree0c5169e50da0fd7272a188087a4b3d5e629c436c /lib
parentbd54402d41d7322bbf0a2cadd9a6acf240ffaaee (diff)
parent50fb13c86186102c255b9f06b25140fffe7c79a6 (diff)
downloadnextcloud-server-121c8bd3030a8a16a100e3630b908b9bd9f8abbf.tar.gz
nextcloud-server-121c8bd3030a8a16a100e3630b908b9bd9f8abbf.zip
Merge pull request #2747 from owncloud/cache-contructed-cache-objects
Remember the contructed OC\Files\Cache\* classes in OC\Files\Storage\Com...
Diffstat (limited to 'lib')
-rw-r--r--lib/files/storage/common.php24
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/files/storage/common.php b/lib/files/storage/common.php
index 8aa227ec0b7..38fe5e546f6 100644
--- a/lib/files/storage/common.php
+++ b/lib/files/storage/common.php
@@ -21,6 +21,10 @@ namespace OC\Files\Storage;
*/
abstract class Common implements \OC\Files\Storage\Storage {
+ private $cache;
+ private $scanner;
+ private $permissioncache;
+ private $watcher;
public function __construct($parameters) {
}
@@ -269,19 +273,31 @@ abstract class Common implements \OC\Files\Storage\Storage {
}
public function getCache($path = '') {
- return new \OC\Files\Cache\Cache($this);
+ if (!isset($this->cache)) {
+ $this->cache = new \OC\Files\Cache\Cache($this);
+ }
+ return $this->cache;
}
public function getScanner($path = '') {
- return new \OC\Files\Cache\Scanner($this);
+ if (!isset($this->scanner)) {
+ $this->scanner = new \OC\Files\Cache\Scanner($this);
+ }
+ return $this->scanner;
}
public function getPermissionsCache($path = '') {
- return new \OC\Files\Cache\Permissions($this);
+ if (!isset($this->permissioncache)) {
+ $this->permissioncache = new \OC\Files\Cache\Permissions($this);
+ }
+ return $this->permissioncache;
}
public function getWatcher($path = '') {
- return new \OC\Files\Cache\Watcher($this);
+ if (!isset($this->watcher)) {
+ $this->watcher = new \OC\Files\Cache\Watcher($this);
+ }
+ return $this->watcher;
}
/**