cache = Gallery3_DAV_Cache::instance(); $this->item = $this->cache->to_item($path); if (access::can("view_full", $this->item)) { $this->stat = stat($this->item->file_path()); $this->path = $this->item->file_path(); } else { $this->stat = stat($this->item->resize_path()); $this->path = $this->item->resize_path(); } } public function delete() { if (!access::can("edit", $this->item)) { throw new Sabre_DAV_Exception_Forbidden("Access denied"); }; $this->item->delete(); } function setName($name) { if (!access::can("edit", $this->item)) { throw new Sabre_DAV_Exception_Forbidden("Access denied"); }; $this->item->name = $name; $this->item->save(); } public function getLastModified() { return $this->item->updated; } function get() { if (!access::can("view", $this->item)) { throw new Sabre_DAV_Exception_Forbidden("Access denied"); }; return fopen($this->path, "r"); } function getSize() { return $this->stat[7]; } function getName() { return $this->item->name; } function getETag() { if (!access::can("view", $this->item)) { throw new Sabre_DAV_Exception_Forbidden("Access denied"); }; return "'" . md5($this->item->file_path()) . "'"; } }