summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doku.php3
-rw-r--r--inc/infoutils.php18
2 files changed, 21 insertions, 0 deletions
diff --git a/doku.php b/doku.php
index 48ac56682..74ba1db6f 100644
--- a/doku.php
+++ b/doku.php
@@ -76,5 +76,8 @@
trigger_event('DOKUWIKI_DONE', $tmp=array());
+ //handle metadebug request
+ debug_meta($ID);
+
// xdebug_dump_function_profile(1);
?>
diff --git a/inc/infoutils.php b/inc/infoutils.php
index 98bd22352..ab8bc8deb 100644
--- a/inc/infoutils.php
+++ b/inc/infoutils.php
@@ -247,4 +247,22 @@ function dbglog($msg){
}
}
+/**
+ * Prints the metadata of a given page
+ *
+ * Only prints when debugging is allowed and the metadebug request
+ * parameter is set
+ *
+ * The data is dumped after tpl_action and thus after the template's
+ * closing html tag. This makes the HTML invalid, but this is for
+ * debugging only anyway.
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+function debug_meta($id){
+ global $conf;
+ if(!$conf['allowdebug']) return;
+ if(!$_REQUEST['metadebug']) return;
+ dbg(p_get_metadata($id));
+}