summaryrefslogtreecommitdiffstats
path: root/lib/connector/sabre
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-06-15 17:04:37 +0200
committerBart Visscher <bartv@thisnet.nl>2012-06-15 21:21:42 +0200
commit27efdbd58f284c054ae9150ff2a2b0dcb5fab70f (patch)
tree5156e40813b6c9d3ddbe2ef5671fb762132c3ad8 /lib/connector/sabre
parentf06c08a63742de9adea4a146a4480b71ad254f20 (diff)
downloadnextcloud-server-27efdbd58f284c054ae9150ff2a2b0dcb5fab70f.tar.gz
nextcloud-server-27efdbd58f284c054ae9150ff2a2b0dcb5fab70f.zip
Use setter for FileinfoCache
Diffstat (limited to 'lib/connector/sabre')
-rw-r--r--lib/connector/sabre/directory.php10
-rw-r--r--lib/connector/sabre/node.php12
2 files changed, 11 insertions, 11 deletions
diff --git a/lib/connector/sabre/directory.php b/lib/connector/sabre/directory.php
index 5aa70392d76..6af4dd36562 100644
--- a/lib/connector/sabre/directory.php
+++ b/lib/connector/sabre/directory.php
@@ -69,15 +69,13 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
if (!$info) throw new Sabre_DAV_Exception_NotFound('File with name ' . $path . ' could not be located');
if ($info['mimetype'] == 'httpd/unix-directory') {
-
- return new OC_Connector_Sabre_Directory($path, $info);
-
+ $node = new OC_Connector_Sabre_Directory($path);
} else {
-
- return new OC_Connector_Sabre_File($path, $info);
-
+ $node = new OC_Connector_Sabre_File($path);
}
+ $node->setFileinfoCache($info);
+ return $node;
}
/**
diff --git a/lib/connector/sabre/node.php b/lib/connector/sabre/node.php
index e5c059f0c8a..8a860242f28 100644
--- a/lib/connector/sabre/node.php
+++ b/lib/connector/sabre/node.php
@@ -41,11 +41,8 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
* @param string $path
* @return void
*/
- public function __construct($path, $fileinfo_cache = null) {
+ public function __construct($path) {
$this->path = $path;
- if ($fileinfo_cache) {
- $this->fileinfo_cache = $fileinfo_cache;
- }
}
@@ -85,8 +82,13 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
}
+ public function setFileinfoCache($fileinfo_cache)
+ {
+ $this->fileinfo_cache = $fileinfo_cache;
+ }
+
/**
- * Set the stat cache
+ * Make sure the fileinfo cache is filled. Uses OC_FileCache or a direct stat
*/
protected function getFileinfoCache() {
if (!isset($this->fileinfo_cache)) {