Check if ReflectionMethod::getDocComment is working

This commit is contained in:
Thomas Tanghus 2014-03-07 02:53:33 +01:00 committed by Thomas Müller
parent 1083085e6e
commit 287c8981bc
3 changed files with 28 additions and 0 deletions

View File

@ -938,6 +938,18 @@ class OC_Util {
return true;
}
/**
* Check if it's possible to get the inline annotations
*
* @return bool
*/
public static function isAnnotationsWorking() {
$reflection = new \ReflectionMethod(__METHOD__);
$docs = $reflection->getDocComment();
return (is_string($docs) && strlen($docs) > 50);
}
/**
* @brief Check if the PHP module fileinfo is loaded.
* @return bool

View File

@ -38,6 +38,7 @@ $tmpl->assign('entriesremain', $entriesremain);
$tmpl->assign('htaccessworking', $htaccessworking);
$tmpl->assign('internetconnectionworking', OC_Util::isInternetConnectionEnabled() ? OC_Util::isInternetConnectionWorking() : false);
$tmpl->assign('isLocaleWorking', OC_Util::isSetLocaleWorking());
$tmpl->assign('isAnnotationsWorking', OC_Util::isAnnotationsWorking());
$tmpl->assign('isWebDavWorking', OC_Util::isWebDAVWorking());
$tmpl->assign('has_fileinfo', OC_Util::fileInfoLoaded());
$tmpl->assign('old_php', OC_Util::isPHPoutdated());

View File

@ -83,6 +83,21 @@ if (!$_['isWebDavWorking']) {
<?php
}
// Are doc blocks accessible?
if (!$_['isAnnotationsWorking']) {
?>
<fieldset class="personalblock">
<h2><?php p($l->t('Setup Warning'));?></h2>
<span class="securitywarning">
<?php p($l->t('PHP is apparently setup to strip inline doc blocks. This will make several core apps inaccessible.')); ?>
<?php p($l->t('This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator.')); ?>
</span>
</fieldset>
<?php
}
// if module fileinfo available?
if (!$_['has_fileinfo']) {
?>