Merge pull request #16440 from marcelklehr/fix/objectstorage-put-contents
Fix File#putContents(string) on ObjectStorage
This commit is contained in:
commit
48653d1a27
|
@ -410,10 +410,10 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function file_put_contents($path, $data) {
|
public function file_put_contents($path, $data) {
|
||||||
$stream = fopen('php://temp', 'r+');
|
$handle = $this->fopen($path, 'w+');
|
||||||
fwrite($stream, $data);
|
fwrite($handle, $data);
|
||||||
rewind($stream);
|
fclose($handle);
|
||||||
return $this->writeStream($path, $stream, strlen($data)) > 0;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function writeStream(string $path, $stream, int $size = null): int {
|
public function writeStream(string $path, $stream, int $size = null): int {
|
||||||
|
|
Loading…
Reference in New Issue