[Pkg-owncloud-commits] [owncloud] 09/199: Check if ReflectionMethod::getDocComment is working

David Prévot taffit at moszumanska.debian.org
Sun Jun 1 18:53:02 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 287c8981bce2027bcda24c30c79704e2ebe6f779
Author: Thomas Tanghus <thomas at tanghus.net>
Date:   Fri Mar 7 02:53:33 2014 +0100

    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 e2005d3..5d747c3 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 49dde59..bd13543 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 d8a800c..d6aa867 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']) {
 	?>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list