summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-11-26 12:37:25 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-11-26 12:37:25 +0100
commit3882cc8ef37a28972a8fca35ca1cc26cc060e7bc (patch)
tree418355ee610c1fea96cc6bf1f36ae8a306400ba9 /lib
parentff7d1eb9312299a07cf594feda76b33ccc982157 (diff)
parent0b8296a756a873b11a528d59dc06e818b0d6fda5 (diff)
downloadnextcloud-server-3882cc8ef37a28972a8fca35ca1cc26cc060e7bc.tar.gz
nextcloud-server-3882cc8ef37a28972a8fca35ca1cc26cc060e7bc.zip
Merge pull request #20744 from owncloud/oc_helper-getMimeType-cleanup
Remove last occurences of OC_Helper::getMimeType()
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/objectstore/objectstorestorage.php2
-rw-r--r--lib/private/helper.php12
-rw-r--r--lib/private/installer.php2
-rw-r--r--lib/public/files.php2
4 files changed, 3 insertions, 15 deletions
diff --git a/lib/private/files/objectstore/objectstorestorage.php b/lib/private/files/objectstore/objectstorestorage.php
index e108d7662d4..5ec05a3529e 100644
--- a/lib/private/files/objectstore/objectstorestorage.php
+++ b/lib/private/files/objectstore/objectstorestorage.php
@@ -370,7 +370,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
$stat['size'] = filesize($tmpFile);
$stat['mtime'] = $mTime;
$stat['storage_mtime'] = $mTime;
- $stat['mimetype'] = \OC_Helper::getMimeType($tmpFile);
+ $stat['mimetype'] = \OC::$server->getMimeTypeDetector()->detect($tmpFile);
$stat['etag'] = $this->getETag($path);
$fileId = $this->getCache()->put($path, $stat);
diff --git a/lib/private/helper.php b/lib/private/helper.php
index 109b9b7ac08..fc7653baf6f 100644
--- a/lib/private/helper.php
+++ b/lib/private/helper.php
@@ -402,18 +402,6 @@ class OC_Helper {
}
/**
- * get the mimetype form a local file
- *
- * @param string $path
- * @return string
- * does NOT work for ownClouds filesystem, use OC_FileSystem::getMimeType instead
- * @deprecated 8.2.0 Use \OC::$server->getMimeTypeDetector()->detect($path)
- */
- static function getMimeType($path) {
- return \OC::$server->getMimeTypeDetector()->detect($path);
- }
-
- /**
* Get a secure mimetype that won't expose potential XSS.
*
* @param string $mimeType
diff --git a/lib/private/installer.php b/lib/private/installer.php
index 86968a7c189..021e496392f 100644
--- a/lib/private/installer.php
+++ b/lib/private/installer.php
@@ -278,7 +278,7 @@ class OC_Installer{
}
//detect the archive type
- $mime=OC_Helper::getMimeType($path);
+ $mime = \OC::$server->getMimeTypeDetector()->detect($path);
if ($mime !=='application/zip' && $mime !== 'application/x-gzip' && $mime !== 'application/x-bzip2') {
throw new \Exception($l->t("Archives of type %s are not supported", array($mime)));
}
diff --git a/lib/public/files.php b/lib/public/files.php
index c1dcffcbefb..e3582375f38 100644
--- a/lib/public/files.php
+++ b/lib/public/files.php
@@ -60,7 +60,7 @@ class Files {
* @since 5.0.0
*/
static function getMimeType( $path ) {
- return(\OC_Helper::getMimeType( $path ));
+ return \OC::$server->getMimeTypeDetector()->detect($path);
}
/**