Merge lp:~edb/quam-plures/debug_logged-in_only into lp:quam-plures

Proposed by EdB
Status: Merged
Merged at revision: 7637
Proposed branch: lp:~edb/quam-plures/debug_logged-in_only
Merge into: lp:quam-plures
Diff against target: 125 lines (+41/-12)
4 files modified
qp_config/_advanced.php (+10/-0)
qp_inc/_core/_misc.funcs.php (+23/-7)
qp_inc/plugins/_plugin.class.php (+3/-2)
qp_inc/widgets/model/_widget.class.php (+5/-3)
To merge this branch: bzr merge lp:~edb/quam-plures/debug_logged-in_only
Reviewer Review Type Date Requested Status
Tilman Blumenbach (community) Approve
Review via email: mp+74047@code.launchpad.net

Description of the change

http://forums.quamplures.net/viewtopic.php?f=6&t=920

Adds $debug_visitors so you can turn on debug for logged in only with normal $debug or for everyone with both $debug and $debug_visitors

To post a comment you must log in.
Revision history for this message
Tilman Blumenbach (tblue) wrote :

Works! ;)

review: Approve
Revision history for this message
Tilman Blumenbach (tblue) wrote :

Does somebody else want to review this one? I usually merge branches after they have been approved by at least two reviewers.

7628. By EdB

matches core 7632

7629. By EdB

core updates

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qp_config/_advanced.php'
2--- qp_config/_advanced.php 2010-09-15 01:18:55 +0000
3+++ qp_config/_advanced.php 2011-10-05 17:42:08 +0000
4@@ -30,6 +30,16 @@
5 */
6 $debug = 0;
7
8+/**
9+ * Display debugging informations to visitors?
10+ *
11+ * $debug always applies to anyone logged in. Set this to 1 if you want to see
12+ * debug info when not logged in (for troubleshooting what a visitor sees).
13+ *
14+ * @global integer
15+ */
16+$debug_visitors = 0;
17+
18 // Most of the time you'll want to see all errors, including notices:
19 // QP should run notice free! (plugins too!)
20 if( ! defined( 'E_DEPRECATED' ) )
21
22=== modified file 'qp_inc/_core/_misc.funcs.php'
23--- qp_inc/_core/_misc.funcs.php 2011-09-02 19:22:04 +0000
24+++ qp_inc/_core/_misc.funcs.php 2011-10-05 17:42:08 +0000
25@@ -1866,28 +1866,44 @@
26 */
27 function debug_info( $force = false, $force_clean = false )
28 {
29- global $debug, $debug_done, $Debuglog, $DB, $obhandler_debug, $Timer, $ReqHost, $ReqPath, $is_cli;
30- global $cache_imgsize, $cache_File;
31- global $Session;
32- global $app_db_config, $app_db_tableprefix;
33+ global $app_db_config;
34+ global $app_db_tableprefix;
35+ global $cache_File;
36+ global $cache_imgsize;
37+ global $DB;
38+ global $debug;
39+ global $debug_done;
40+ global $debug_visitors;
41+ global $Debuglog;
42 /**
43 * @var Hit
44 */
45 global $Hit;
46+ global $is_cli;
47+ global $obhandler_debug;
48+ global $ReqHost;
49+ global $ReqPath;
50+ global $Session;
51+ global $Timer;
52+
53+ if( ! is_logged_in() && ! $debug_visitors )
54+ { // No debug for visitors
55+ return;
56+ }
57
58 if( !$force )
59 {
60- if( !empty($debug_done))
61+ if( !empty( $debug_done ) )
62 { // Already displayed!
63 return;
64 }
65
66- if( empty($debug) )
67+ if( empty( $debug ) )
68 { // No debug output desired:
69 return;
70 }
71
72- if( $debug < 2 && ( empty($Hit) || $Hit->get_agent_type() != 'browser' ) )
73+ if( $debug < 2 && ( empty( $Hit ) || $Hit->get_agent_type() != 'browser' ) )
74 { // Don't display if it's not a browser (very needed for proper RSS display btw)
75 // ($Hit is empty e.g. during install)
76 return;
77
78=== modified file 'qp_inc/plugins/_plugin.class.php'
79--- qp_inc/plugins/_plugin.class.php 2011-09-04 22:27:27 +0000
80+++ qp_inc/plugins/_plugin.class.php 2011-10-05 17:42:08 +0000
81@@ -2500,7 +2500,8 @@
82 {
83 global $plugins_path;
84
85- $globalfile_path = $plugins_path.$this->classname.'/po/php/_global.php';
86+ $globalfile = $this->classname.'/po/php/_global.php';
87+ $globalfile_path = $plugins_path.$globalfile;
88 $trans = & $this->_trans;
89
90 // Load the global messages file, if existing:
91@@ -2514,7 +2515,7 @@
92 }
93 else
94 {
95- $this->debug_log( 'Global messages file '.$globalfile_path.' does not exist or is not readable!', 'locale' );
96+ $this->debug_log( 'Translation file '.$globalfile.' does not exist or is not readable!', 'locale' );
97 }
98 }
99
100
101=== modified file 'qp_inc/widgets/model/_widget.class.php'
102--- qp_inc/widgets/model/_widget.class.php 2011-09-01 02:17:16 +0000
103+++ qp_inc/widgets/model/_widget.class.php 2011-10-05 17:42:08 +0000
104@@ -614,9 +614,11 @@
105 return $this->Plugin->T_( $string, $req_locale );
106 }
107
108- global $plugins_path,$Debuglog;
109+ global $plugins_path;
110+ global $Debuglog;
111
112- $globalfile_path = $plugins_path.$this->code.'_widget/po/php/_global.php';
113+ $globalfile = $this->code.'_widget/po/php/_global.php';
114+ $globalfile_path = $plugins_path.$globalfile;
115 $trans = & $this->_trans;
116
117 // Load the global messages file, if existing:
118@@ -630,7 +632,7 @@
119 }
120 else
121 {
122- $Debuglog->add( 'Global messages file '.$globalfile_path.' does not exist or is not readable!', 'locale' );
123+ $Debuglog->add( 'Translation file '.$globalfile.' does not exist or is not readable!', 'locale' );
124 }
125 }
126

Subscribers

People subscribed via source and target branches