diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2014-03-07 02:53:33 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-05-09 22:44:55 +0200 |
commit | 287c8981bce2027bcda24c30c79704e2ebe6f779 (patch) | |
tree | f97d97b3f911e1c996b3e6778ccc39d6f66656dd | |
parent | 1083085e6e1727d3e9008c0f8a0729fbdade39f3 (diff) | |
download | nextcloud-server-287c8981bce2027bcda24c30c79704e2ebe6f779.tar.gz nextcloud-server-287c8981bce2027bcda24c30c79704e2ebe6f779.zip |
Check if ReflectionMethod::getDocComment is working
-rwxr-xr-x | lib/private/util.php | 12 | ||||
-rwxr-xr-x | settings/admin.php | 1 | ||||
-rw-r--r-- | settings/templates/admin.php | 15 |
3 files changed, 28 insertions, 0 deletions
diff --git a/lib/private/util.php b/lib/private/util.php index e2005d31c38..5d747c36574 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -939,6 +939,18 @@ class OC_Util { } /** + * 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 */ diff --git a/settings/admin.php b/settings/admin.php index 49dde59ce2a..bd135435f16 100755 --- a/settings/admin.php +++ b/settings/admin.php @@ -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()); diff --git a/settings/templates/admin.php b/settings/templates/admin.php index d8a800ca202..d6aa867d469 100644 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -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']) { ?> |