Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/files/storage/home.php')
-rw-r--r--lib/private/files/storage/home.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/private/files/storage/home.php b/lib/private/files/storage/home.php
index bf1d6017cbf..b4ceb8f4f9b 100644
--- a/lib/private/files/storage/home.php
+++ b/lib/private/files/storage/home.php
@@ -13,6 +13,11 @@ namespace OC\Files\Storage;
*/
class Home extends Local {
/**
+ * @var string
+ */
+ protected $id;
+
+ /**
* @var \OC\User\User $user
*/
protected $user;
@@ -20,11 +25,25 @@ class Home extends Local {
public function __construct($arguments) {
$this->user = $arguments['user'];
$datadir = $this->user->getHome();
+ if (isset($arguments['legacy']) && $arguments['legacy']) {
+ // legacy home id (<= 5.0.12)
+ $this->id = 'local::' . $datadir . '/';
+ }
+ else {
+ $this->id = 'home::' . $this->user->getUID();
+ }
parent::__construct(array('datadir' => $datadir));
}
public function getId() {
- return 'home::' . $this->user->getUID();
+ return $this->id;
+ }
+
+ public function getCache($path = '') {
+ if (!isset($this->cache)) {
+ $this->cache = new \OC\Files\Cache\HomeCache($this);
+ }
+ return $this->cache;
}
}