Merge pull request #1443 from owncloud/use-module-file-info-master

we get best results regarding mime type detection if we use fileinfo - l...
This commit is contained in:
Lukas Reschke 2013-02-06 11:53:13 -08:00
commit e969a78cf9
3 changed files with 23 additions and 1 deletions

View File

@ -534,6 +534,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
*/

View File

@ -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'));

View 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">