r107954 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107953‎ | r107954 | r107955 >
Date:22:36, 3 January 2012
Author:johnduhart
Status:resolved (Comments)
Tags:
Comment:
Followup r107862

Fix bug that caused a PHP notice
Vertical-align:top on callers in the console
Modified paths:
  • /trunk/phase3/includes/debug/Debug.php (modified) (history)
  • /trunk/phase3/resources/mediawiki/mediawiki.debug.css (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/debug/Debug.php
@@ -98,9 +98,11 @@
9999
100100 // Check to see if there was already a deprecation notice, so not to
101101 // get a duplicate warning
102 - $lastLog = self::$log[ count( self::$log ) - 1 ];
103 - if ( $lastLog['type'] == 'deprecated' && $lastLog['caller'] == wfGetCaller( $callerOffset + 1 ) ) {
104 - return;
 102+ if ( count( self::$log ) ) {
 103+ $lastLog = self::$log[ count( self::$log ) - 1 ];
 104+ if ( $lastLog['type'] == 'deprecated' && $lastLog['caller'] == wfGetCaller( $callerOffset + 1 ) ) {
 105+ return;
 106+ }
105107 }
106108
107109 self::$log[] = array(
@@ -251,6 +253,8 @@
252254 }
253255
254256 global $wgVersion, $wgRequestTime;
 257+ wfWarn( 'johnduhart is pretty cool' );
 258+ wfDeprecated( __METHOD__, '1.19' );
255259 MWDebug::log( 'MWDebug output complete' );
256260 $debugInfo = array(
257261 'mwVersion' => $wgVersion,
Index: trunk/phase3/resources/mediawiki/mediawiki.debug.css
@@ -135,6 +135,10 @@
136136 vertical-align: top;
137137 }
138138
 139+#mw-debug-console tr td:last-child {
 140+ vertical-align: top;
 141+}
 142+
139143 .mw-debug-console-log {
140144 background-color: #add8e6;
141145 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r107966Followup r107954, rm debugging codejohnduhart23:52, 3 January 2012
r108875MWDebug: avoid double count()...hashar23:10, 13 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r107862Implemented console panel in debug toolbarjohnduhart05:56, 3 January 2012

Comments

#Comment by Krinkle (talk | contribs)   23:49, 3 January 2012
+		wfWarn( 'johnduhart is pretty cool' );

Not everybody needs to know that ;-)

#Comment by Hashar (talk | contribs)   08:55, 4 January 2012

You are counting things twice: count( self::$log )

That logic to check if the warning is a duplicate deprecation should be in deprecated(). That looks hacky this way.

#Comment by Hashar (talk | contribs)   23:08, 13 January 2012

Some tests added with r108873

Status & tagging log