aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-05-30 22:17:30 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-05-30 22:17:30 +0200
commit555b9cc24532945f6a87741b336db535ac5b68cf (patch)
tree1a71c1f59f972190f91e2ea039adee725c377999
parentda6aae28ad0cb1bad3d0693f126a5436af64240d (diff)
parent06af8e09da8ceecf33480f7a0a776df0070c8117 (diff)
downloadnextcloud-server-555b9cc24532945f6a87741b336db535ac5b68cf.tar.gz
nextcloud-server-555b9cc24532945f6a87741b336db535ac5b68cf.zip
Merge pull request #7614 from owncloud/test_annotations_working
Check if ReflectionMethod::getDocComment is working
-rwxr-xr-xlib/private/util.php18
-rwxr-xr-xsettings/admin.php1
-rw-r--r--settings/templates/admin.php15
3 files changed, 34 insertions, 0 deletions
diff --git a/lib/private/util.php b/lib/private/util.php
index bf7f39ebb20..306e37b9478 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(
@@ -996,6 +1002,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);
+ }
+
+ /**
* Check if the PHP module fileinfo is loaded.
* @return bool
*/
diff --git a/settings/admin.php b/settings/admin.php
index 699ba97edd5..a0769892ef4 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 4b25128c30b..a86fe9c0ac7 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']) {
?>