Use setter for FileinfoCache

remotes/origin/stable45
Bart Visscher 13 years ago
parent f06c08a637
commit 27efdbd58f
  1. 10
      lib/connector/sabre/directory.php
  2. 12
      lib/connector/sabre/node.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) 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
* @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
} }
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)) {

Loading…
Cancel
Save