From a18c0983d5db32e98461404888200118f83011d7 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Fri, 18 Dec 2015 11:25:33 +0100 Subject: Use TempManager instead of tmpFile --- lib/private/files/objectstore/objectstorestorage.php | 2 +- lib/private/files/storage/localtempfiletrait.php | 2 +- lib/private/files/type/detection.php | 2 +- lib/private/files/view.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/private/files') diff --git a/lib/private/files/objectstore/objectstorestorage.php b/lib/private/files/objectstore/objectstorestorage.php index a053ea6d6d2..b34a6bdfb84 100644 --- a/lib/private/files/objectstore/objectstorestorage.php +++ b/lib/private/files/objectstore/objectstorestorage.php @@ -274,7 +274,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { } else { $ext = ''; } - $tmpFile = \OC_Helper::tmpFile($ext); + $tmpFile = \OC::$server->getTempManager()->getTemporaryFile($ext); \OC\Files\Stream\Close::registerCallback($tmpFile, array($this, 'writeBack')); if ($this->file_exists($path)) { $source = $this->fopen($path, 'r'); diff --git a/lib/private/files/storage/localtempfiletrait.php b/lib/private/files/storage/localtempfiletrait.php index 84331f49b19..8875c2c4493 100644 --- a/lib/private/files/storage/localtempfiletrait.php +++ b/lib/private/files/storage/localtempfiletrait.php @@ -70,7 +70,7 @@ trait LocalTempFileTrait { } else { $extension = ''; } - $tmpFile = \OC_Helper::tmpFile($extension); + $tmpFile = \OC::$server->getTempManager()->getTemporaryFile($extension); $target = fopen($tmpFile, 'w'); \OC_Helper::streamCopy($source, $target); fclose($target); diff --git a/lib/private/files/type/detection.php b/lib/private/files/type/detection.php index c102e739e04..0e2bab39e5b 100644 --- a/lib/private/files/type/detection.php +++ b/lib/private/files/type/detection.php @@ -238,7 +238,7 @@ class Detection implements IMimeTypeDetector { $finfo = finfo_open(FILEINFO_MIME); return finfo_buffer($finfo, $data); } else { - $tmpFile = \OC_Helper::tmpFile(); + $tmpFile = \OC::$server->getTempManager()->getTemporaryFile(); $fh = fopen($tmpFile, 'wb'); fwrite($fh, $data, 8024); fclose($fh); diff --git a/lib/private/files/view.php b/lib/private/files/view.php index b8b1b8a50d6..fcea4828c49 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -912,7 +912,7 @@ class View { $source = $this->fopen($path, 'r'); if ($source) { $extension = pathinfo($path, PATHINFO_EXTENSION); - $tmpFile = \OC_Helper::tmpFile($extension); + $tmpFile = \OC::$server->getTempManager()->getTemporaryFile($extension); file_put_contents($tmpFile, $source); return $tmpFile; } else { -- cgit v1.2.3