summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/archive/tar.php2
-rw-r--r--lib/private/files/objectstore/objectstorestorage.php2
-rw-r--r--lib/private/files/storage/common.php2
-rw-r--r--lib/private/files/storage/localtempfiletrait.php2
-rw-r--r--lib/private/files/storage/temporary.php2
-rw-r--r--lib/private/files/type/detection.php2
-rw-r--r--lib/private/files/view.php2
-rw-r--r--lib/private/helper.php35
-rw-r--r--lib/private/installer.php4
-rw-r--r--lib/private/preview/movie.php4
10 files changed, 11 insertions, 46 deletions
diff --git a/lib/private/archive/tar.php b/lib/private/archive/tar.php
index 4448e56850d..4066e1d86c1 100644
--- a/lib/private/archive/tar.php
+++ b/lib/private/archive/tar.php
@@ -86,7 +86,7 @@ class OC_Archive_TAR extends OC_Archive {
* @return bool
*/
function addFolder($path) {
- $tmpBase = OC_Helper::tmpFolder();
+ $tmpBase = \OC::$server->getTempManager()->getTemporaryFolder();
if (substr($path, -1, 1) != '/') {
$path .= '/';
}
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/common.php b/lib/private/files/storage/common.php
index 091f2edb629..1e30d48f613 100644
--- a/lib/private/files/storage/common.php
+++ b/lib/private/files/storage/common.php
@@ -248,7 +248,7 @@ abstract class Common implements Storage {
}
public function getLocalFolder($path) {
- $baseDir = \OC_Helper::tmpFolder();
+ $baseDir = \OC::$server->getTempManager()->getTemporaryFolder();
$this->addLocalFolder($path, $baseDir);
return $baseDir;
}
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/storage/temporary.php b/lib/private/files/storage/temporary.php
index c8b99a55637..8abc19929b0 100644
--- a/lib/private/files/storage/temporary.php
+++ b/lib/private/files/storage/temporary.php
@@ -29,7 +29,7 @@ namespace OC\Files\Storage;
*/
class Temporary extends Local{
public function __construct($arguments = null) {
- parent::__construct(array('datadir' => \OC_Helper::tmpFolder()));
+ parent::__construct(array('datadir' => \OC::$server->getTempManager()->getTemporaryFolder()));
}
public function cleanUp() {
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 {
diff --git a/lib/private/helper.php b/lib/private/helper.php
index 72282362fe6..c6223d2147a 100644
--- a/lib/private/helper.php
+++ b/lib/private/helper.php
@@ -165,16 +165,6 @@ class OC_Helper {
}
/**
- * shows whether the user has an avatar
- * @param string $user username
- * @return bool avatar set or not
- * @deprecated 9.0.0 Use \OC::$server->getAvatarManager()->getAvatar($user)->exists();
- **/
- public static function userAvatarSet($user) {
- return \OC::$server->getAvatarManager()->getAvatar($user)->exists();
- }
-
- /**
* Make a human file size
* @param int $bytes file size in bytes
* @return string a human readable file size
@@ -457,31 +447,6 @@ class OC_Helper {
}
/**
- * create a temporary file with an unique filename
- *
- * @param string $postfix
- * @return string
- * @deprecated Use the TempManager instead
- *
- * temporary files are automatically cleaned up after the script is finished
- */
- public static function tmpFile($postfix = '') {
- return \OC::$server->getTempManager()->getTemporaryFile($postfix);
- }
-
- /**
- * create a temporary folder with an unique filename
- *
- * @return string
- * @deprecated Use the TempManager instead
- *
- * temporary files are automatically cleaned up after the script is finished
- */
- public static function tmpFolder() {
- return \OC::$server->getTempManager()->getTemporaryFolder();
- }
-
- /**
* Adds a suffix to the name in case the file exists
*
* @param string $path
diff --git a/lib/private/installer.php b/lib/private/installer.php
index fa9fc6704df..e1447db0db5 100644
--- a/lib/private/installer.php
+++ b/lib/private/installer.php
@@ -264,7 +264,7 @@ class OC_Installer{
//download the file if necessary
if($data['source']=='http') {
$pathInfo = pathinfo($data['href']);
- $path=OC_Helper::tmpFile('.' . $pathInfo['extension']);
+ $path = \OC::$server->getTempManager()->getTemporaryFile('.' . $pathInfo['extension']);
if(!isset($data['href'])) {
throw new \Exception($l->t("No href specified when installing app from http"));
}
@@ -284,7 +284,7 @@ class OC_Installer{
}
//extract the archive in a temporary folder
- $extractDir=OC_Helper::tmpFolder();
+ $extractDir = \OC::$server->getTempManager()->getTemporaryFolder();
OC_Helper::rmdirr($extractDir);
mkdir($extractDir);
if($archive=OC_Archive::open($path)) {
diff --git a/lib/private/preview/movie.php b/lib/private/preview/movie.php
index f71eaaf3eb2..2c2e6d09399 100644
--- a/lib/private/preview/movie.php
+++ b/lib/private/preview/movie.php
@@ -46,7 +46,7 @@ class Movie extends Provider {
if ($useFileDirectly) {
$absPath = $fileview->getLocalFile($path);
} else {
- $absPath = \OC_Helper::tmpFile();
+ $absPath = \OC::$server->getTempManager()->getTemporaryFile();
$handle = $fileview->fopen($path, 'rb');
@@ -79,7 +79,7 @@ class Movie extends Provider {
* @return bool|\OCP\IImage
*/
private function generateThumbNail($maxX, $maxY, $absPath, $second) {
- $tmpPath = \OC_Helper::tmpFile();
+ $tmpPath = \OC::$server->getTempManager()->getTemporaryFile();
if (self::$avconvBinary) {
$cmd = self::$avconvBinary . ' -an -y -ss ' . escapeshellarg($second) .