From 287c8981bce2027bcda24c30c79704e2ebe6f779 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Fri, 7 Mar 2014 02:53:33 +0100 Subject: [PATCH] Check if ReflectionMethod::getDocComment is working --- lib/private/util.php | 12 ++++++++++++ settings/admin.php | 1 + settings/templates/admin.php | 15 +++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/lib/private/util.php b/lib/private/util.php index e2005d31c3..5d747c3657 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -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 diff --git a/settings/admin.php b/settings/admin.php index 49dde59ce2..bd135435f1 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 d8a800ca20..d6aa867d46 100644 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -83,6 +83,21 @@ if (!$_['isWebDavWorking']) { +
+

t('Setup Warning'));?>

+ + + t('PHP is apparently setup to strip inline doc blocks. This will make several core apps inaccessible.')); ?> + t('This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator.')); ?> + + +
+