Index: trunk/phase3/includes/debug/Debug.php |
— | — | @@ -3,6 +3,9 @@ |
4 | 4 | /** |
5 | 5 | * New debugger system that outputs a toolbar on page view |
6 | 6 | * |
| 7 | + * By default, most methods do nothing ( self::$enabled = false ). You have |
| 8 | + * to explicitly call MWDebug::init() to enabled them. |
| 9 | + * |
7 | 10 | * @todo Profiler support |
8 | 11 | */ |
9 | 12 | class MWDebug { |
— | — | @@ -40,7 +43,7 @@ |
41 | 44 | * |
42 | 45 | * @var bool |
43 | 46 | */ |
44 | | - protected static $enabled = true; |
| 47 | + protected static $enabled = false; |
45 | 48 | |
46 | 49 | /** |
47 | 50 | * Array of functions that have already been warned, formatted |
— | — | @@ -51,17 +54,11 @@ |
52 | 55 | protected static $deprecationWarnings = array(); |
53 | 56 | |
54 | 57 | /** |
55 | | - * Called in Setup.php, initializes the debugger if it is enabled with |
56 | | - * $wgDebugToolbar |
| 58 | + * Enabled the debugger and load resource module. |
| 59 | + * This is called by Setup.php when $wgDebugToolbar is true. |
57 | 60 | */ |
58 | 61 | public static function init() { |
59 | | - global $wgDebugToolbar; |
60 | | - |
61 | | - if ( !$wgDebugToolbar ) { |
62 | | - self::$enabled = false; |
63 | | - return; |
64 | | - } |
65 | | - |
| 62 | + self::$enabled = true; |
66 | 63 | RequestContext::getMain()->getOutput()->addModules( 'mediawiki.debug' ); |
67 | 64 | } |
68 | 65 | |
Index: trunk/phase3/includes/Setup.php |
— | — | @@ -359,7 +359,9 @@ |
360 | 360 | $wgCookieSecure = ( substr( $wgServer, 0, 6 ) === 'https:' ); |
361 | 361 | } |
362 | 362 | |
363 | | -MWDebug::init(); |
| 363 | +if ( $wgDebugToolbar ) { |
| 364 | + MWDebug::init(); |
| 365 | +} |
364 | 366 | |
365 | 367 | if ( !defined( 'MW_COMPILED' ) ) { |
366 | 368 | if ( !MWInit::classExists( 'AutoLoader' ) ) { |