diff --git a/lib/private/util.php b/lib/private/util.php index bf7f39ebb2058e0097a62395b0da740859a6475c..306e37b947841cd43fda6803016ebca37c407265 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -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 diff --git a/settings/admin.php b/settings/admin.php index 699ba97edd5ed5a713b73766699efd0fc4f0844c..a0769892ef44d553b9368ab65dc520c9f913918b 100755 --- a/settings/admin.php +++ b/settings/admin.php @@ -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()); diff --git a/settings/templates/admin.php b/settings/templates/admin.php index 4b25128c30b39e2e3089e504a172cc2346895e24..a86fe9c0ac7feeb9e39e4a507f86bdf371867dd9 100644 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -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']) { ?>