Skip to content
Snippets Groups Projects
Commit 27efdbd5 authored by Bart Visscher's avatar Bart Visscher
Browse files

Use setter for FileinfoCache

parent f06c08a6
No related branches found
No related tags found
No related merge requests found
...@@ -69,15 +69,13 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa ...@@ -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) throw new Sabre_DAV_Exception_NotFound('File with name ' . $path . ' could not be located');
if ($info['mimetype'] == 'httpd/unix-directory') { if ($info['mimetype'] == 'httpd/unix-directory') {
$node = new OC_Connector_Sabre_Directory($path);
return new OC_Connector_Sabre_Directory($path, $info);
} else { } else {
$node = new OC_Connector_Sabre_File($path);
return new OC_Connector_Sabre_File($path, $info);
} }
$node->setFileinfoCache($info);
return $node;
} }
/** /**
......
...@@ -41,11 +41,8 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr ...@@ -41,11 +41,8 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
* @param string $path * @param string $path
* @return void * @return void
*/ */
public function __construct($path, $fileinfo_cache = null) { public function __construct($path) {
$this->path = $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 ...@@ -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() { protected function getFileinfoCache() {
if (!isset($this->fileinfo_cache)) { if (!isset($this->fileinfo_cache)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment