Merge pull request #7614 from owncloud/test_annotations_working

Check if ReflectionMethod::getDocComment is working
This commit is contained in:
Thomas Müller 2014-05-30 22:17:30 +02:00
commit 555b9cc245
3 changed files with 34 additions and 0 deletions

View File

@ -516,6 +516,12 @@ class OC_Util {
);
$webServerRestart = true;
}
if (!self::isAnnotationsWorking()) {
$errors[] = array(
'error'=>'PHP is apparently setup to strip inline doc blocks. This will make several core apps inaccessible.',
'hint'=>'This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator.'
);
}
if($webServerRestart) {
$errors[] = array(
@ -995,6 +1001,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);
}
/**
* Check if the PHP module fileinfo is loaded.
* @return bool

View File

@ -39,6 +39,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']) {
?>
<div class="section">
<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>
</div>
<?php
}
// if module fileinfo available?
if (!$_['has_fileinfo']) {
?>