From 6058c2f734ca2259aebab9cc83eb63c2718b2e4d Mon Sep 17 00:00:00 2001 From: Thomas Mueller Date: Mon, 4 Feb 2013 15:04:26 +0100 Subject: [PATCH] we get best results regarding mime type detection if we use fileinfo - let's tell the admin about that --- lib/util.php | 8 ++++++++ settings/admin.php | 1 + settings/templates/admin.php | 15 ++++++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/util.php b/lib/util.php index 91970ab2b9..4de34b9dfd 100755 --- a/lib/util.php +++ b/lib/util.php @@ -516,6 +516,14 @@ class OC_Util { } } + /** + * Check if the PHP module fileinfo is loaded. + * @return bool + */ + public static function fileInfoLoaded() { + return function_exists('finfo_open'); + } + /** * Check if the ownCloud server can connect to the internet */ diff --git a/settings/admin.php b/settings/admin.php index 4d9685ab92..7cca716515 100755 --- a/settings/admin.php +++ b/settings/admin.php @@ -31,6 +31,7 @@ $tmpl->assign('entriesremain', $entriesremain); $tmpl->assign('htaccessworking', $htaccessworking); $tmpl->assign('internetconnectionworking', OC_Util::isinternetconnectionworking()); $tmpl->assign('islocaleworking', OC_Util::issetlocaleworking()); +$tmpl->assign('has_fileinfo', OC_Util::fileInfoLoaded()); $tmpl->assign('backgroundjobs_mode', OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax')); $tmpl->assign('shareAPIEnabled', OC_Appconfig::getValue('core', 'shareapi_enabled', 'yes')); diff --git a/settings/templates/admin.php b/settings/templates/admin.php index 0097489743..9a9a691dcb 100644 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -22,7 +22,20 @@ if (!$_['htaccessworking']) { +
+ t('Module \'fileinfo\' missing');?> + + + t('The PHP module \'fileinfo\' is missing. We strongly recommend to enable this module to get best results with mime-type detection.'); ?> + + +
+