Use setter for FileinfoCache

This commit is contained in:
Bart Visscher 2012-06-15 17:04:37 +02:00
parent f06c08a637
commit 27efdbd58f
2 changed files with 11 additions and 11 deletions

View File

@ -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;
}
/**

View File

@ -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)) {