mirror of
https://github.com/nextcloud/server.git
synced 2026-02-21 08:51:45 -05:00
better file_get_contents, file_put_contents and toTmpFile for archive storage backend
This commit is contained in:
parent
3da1339cd8
commit
2ea46ee1ca
1 changed files with 13 additions and 0 deletions
|
|
@ -111,6 +111,19 @@ class OC_Filestorage_Archive extends OC_Filestorage_Common{
|
|||
return false;//not supported
|
||||
}
|
||||
}
|
||||
private function toTmpFile($path){
|
||||
$tmpFile=OC_Helper::tmpFile($extension);
|
||||
$this->archive->extractFile($path,$tmpFile);
|
||||
return $tmpFile;
|
||||
}
|
||||
public function file_put_contents($path,$data) {
|
||||
$path=$this->stripPath($path);
|
||||
return $this->archive->addFile($path,$data);
|
||||
}
|
||||
public function file_get_contents($path) {
|
||||
$path=$this->stripPath($path);
|
||||
return $this->archive->getFile($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* automount paths from file hooks
|
||||
|
|
|
|||
Loading…
Reference in a new issue