]> source.dussan.org Git - nextcloud-server.git/commitdiff
we get best results regarding mime type detection if we use fileinfo - let's tell...
authorThomas Mueller <thomas.mueller@tmit.eu>
Mon, 4 Feb 2013 14:04:26 +0000 (15:04 +0100)
committerThomas Mueller <thomas.mueller@tmit.eu>
Mon, 4 Feb 2013 14:04:26 +0000 (15:04 +0100)
lib/util.php
settings/admin.php
settings/templates/admin.php

index 91970ab2b9663010e07f921d5cdc08617d7f6c14..4de34b9dfda46443b62602089a7544a25f22d48b 100755 (executable)
@@ -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
         */
index 4d9685ab9208cff5bbde353d98016cc8a143f4fb..7cca716515390fc9cda2bccf151ed4329deca2e9 100755 (executable)
@@ -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'));
 
index 0097489743f6230bb1abea6d54c8490f4e933ea9..9a9a691dcbfa5569f6331d21910054bbc81eac9b 100644 (file)
@@ -22,7 +22,20 @@ if (!$_['htaccessworking']) {
 <?php
 }
 
-// is locale working ?
+// if module fileinfo available?
+if (!$_['has_fileinfo']) {
+       ?>
+<fieldset class="personalblock">
+       <legend><strong><?php echo $l->t('Module \'fileinfo\' missing');?></strong></legend>
+
+               <span class="connectionwarning">
+               <?php echo $l->t('The PHP module \'fileinfo\' is missing. We strongly recommend to enable this module to get best results with mime-type detection.'); ?>
+       </span>
+
+</fieldset>
+<?php
+}
+
 if (!$_['islocaleworking']) {
        ?>
 <fieldset class="personalblock">