MediaWiki  master
MWDebug.php
Go to the documentation of this file.
1 <?php
24 use Wikimedia\WrappedString;
25 use Wikimedia\WrappedStringList;
26 
35 class MWDebug {
41  protected static $log = [];
42 
48  protected static $debug = [];
49 
55  protected static $query = [];
56 
62  protected static $enabled = false;
63 
70  protected static $deprecationWarnings = [];
71 
75  protected static $deprecationFilters = [];
76 
80  public static function setup() {
81  global $wgDebugToolbar,
83 
84  if (
85  // Easy to forget to falsify $wgDebugToolbar for static caches.
86  // If file cache or CDN cache is on, just disable this (DWIMD).
87  $wgUseCdn ||
89  // Keep MWDebug off on CLI. This prevents MWDebug from eating up
90  // all the memory for logging SQL queries in maintenance scripts.
92  ) {
93  return;
94  }
95 
96  if ( $wgDebugToolbar ) {
97  self::init();
98  }
99  }
100 
107  public static function init() {
108  self::$enabled = true;
109  }
110 
116  public static function deinit() {
117  self::$enabled = false;
118  }
119 
127  public static function addModules( OutputPage $out ) {
128  if ( self::$enabled ) {
129  $out->addModules( 'mediawiki.debug' );
130  }
131  }
132 
139  public static function log( $str ) {
140  if ( !self::$enabled ) {
141  return;
142  }
143  if ( !is_string( $str ) ) {
144  $str = print_r( $str, true );
145  }
146  self::$log[] = [
147  'msg' => htmlspecialchars( $str ),
148  'type' => 'log',
149  'caller' => wfGetCaller(),
150  ];
151  }
152 
158  public static function getLog() {
159  return self::$log;
160  }
161 
166  public static function clearLog() {
167  self::$log = [];
168  self::$deprecationWarnings = [];
169  }
170 
182  public static function warning( $msg, $callerOffset = 1, $level = E_USER_NOTICE, $log = 'auto' ) {
183  global $wgDevelopmentWarnings;
184 
185  if ( $log === 'auto' && !$wgDevelopmentWarnings ) {
186  $log = 'debug';
187  }
188 
189  if ( $log === 'debug' ) {
190  $level = false;
191  }
192 
193  $callerDescription = self::getCallerDescription( $callerOffset );
194 
196  self::formatCallerDescription( $msg, $callerDescription ),
197  'warning',
198  $level );
199 
200  if ( self::$enabled ) {
201  self::$log[] = [
202  'msg' => htmlspecialchars( $msg ),
203  'type' => 'warn',
204  'caller' => $callerDescription['func'],
205  ];
206  }
207  }
208 
223  public static function deprecated( $function, $version = false,
224  $component = false, $callerOffset = 2
225  ) {
226  if ( $version ) {
227  $component = $component ?: 'MediaWiki';
228  $msg = "Use of $function was deprecated in $component $version.";
229  } else {
230  $msg = "Use of $function is deprecated.";
231  }
232  self::deprecatedMsg( $msg, $version, $component, $callerOffset + 1 );
233  }
234 
257  public static function detectDeprecatedOverride( $instance, $class, $method, $version = false,
258  $component = false, $callerOffset = 2
259  ) {
260  $reflectionMethod = new ReflectionMethod( $instance, $method );
261  $declaringClass = $reflectionMethod->getDeclaringClass()->getName();
262 
263  if ( $declaringClass === $class ) {
264  // not overridden, nothing to do
265  return false;
266  }
267 
268  if ( $version ) {
269  $component = $component ?: 'MediaWiki';
270  $msg = "$declaringClass overrides $method which was deprecated in $component $version.";
271  self::deprecatedMsg( $msg, $version, $component, $callerOffset + 1 );
272  }
273 
274  return true;
275  }
276 
305  public static function deprecatedMsg( $msg, $version = false,
306  $component = false, $callerOffset = 2
307  ) {
308  if ( $callerOffset === false ) {
309  $callerFunc = '';
310  $rawMsg = $msg;
311  } else {
312  $callerDescription = self::getCallerDescription( $callerOffset );
313  $callerFunc = $callerDescription['func'];
314  $rawMsg = self::formatCallerDescription( $msg, $callerDescription );
315  }
316 
317  $sendToLog = true;
318 
319  // Check to see if there already was a warning about this function
320  if ( isset( self::$deprecationWarnings[$msg][$callerFunc] ) ) {
321  return;
322  } elseif ( isset( self::$deprecationWarnings[$msg] ) ) {
323  if ( self::$enabled ) {
324  $sendToLog = false;
325  } else {
326  return;
327  }
328  }
329 
330  self::$deprecationWarnings[$msg][$callerFunc] = true;
331 
332  if ( $version ) {
334 
335  $component = $component ?: 'MediaWiki';
336  if ( $wgDeprecationReleaseLimit && $component === 'MediaWiki' ) {
337  # Strip -* off the end of $version so that branches can use the
338  # format #.##-branchname to avoid issues if the branch is merged into
339  # a version of MediaWiki later than what it was branched from
340  $comparableVersion = preg_replace( '/-.*$/', '', $version );
341 
342  # If the comparableVersion is larger than our release limit then
343  # skip the warning message for the deprecation
344  if ( version_compare( $wgDeprecationReleaseLimit, $comparableVersion, '<' ) ) {
345  $sendToLog = false;
346  }
347  }
348  }
349 
351  $rawMsg,
352  $sendToLog,
353  $callerFunc
354  );
355  }
356 
369  public static function sendRawDeprecated( $msg, $sendToLog = true, $callerFunc = '' ) {
370  foreach ( self::$deprecationFilters as $filter ) {
371  if ( preg_match( $filter, $msg ) ) {
372  return;
373  }
374  }
375 
376  if ( $sendToLog ) {
377  trigger_error( $msg, E_USER_DEPRECATED );
378  }
379 
380  if ( self::$enabled ) {
381  $logMsg = htmlspecialchars( $msg ) .
382  Html::rawElement( 'div', [ 'class' => 'mw-debug-backtrace' ],
383  Html::element( 'span', [], 'Backtrace:' ) . wfBacktrace()
384  );
385 
386  self::$log[] = [
387  'msg' => $logMsg,
388  'type' => 'deprecated',
389  'caller' => $callerFunc,
390  ];
391  }
392  }
393 
400  public static function filterDeprecationForTest( $regex ) {
401  if ( !defined( 'MW_PHPUNIT_TEST' ) && !defined( 'MW_PARSER_TEST' ) ) {
402  throw new RuntimeException( __METHOD__ . ' can only be used in tests' );
403  }
404  self::$deprecationFilters[] = $regex;
405  }
406 
410  public static function clearDeprecationFilters() {
411  self::$deprecationFilters = [];
412  }
413 
421  private static function getCallerDescription( $callerOffset ) {
422  $callers = wfDebugBacktrace();
423 
424  if ( isset( $callers[$callerOffset] ) ) {
425  $callerfile = $callers[$callerOffset];
426  if ( isset( $callerfile['file'] ) && isset( $callerfile['line'] ) ) {
427  $file = $callerfile['file'] . ' at line ' . $callerfile['line'];
428  } else {
429  $file = '(internal function)';
430  }
431  } else {
432  $file = '(unknown location)';
433  }
434 
435  if ( isset( $callers[$callerOffset + 1] ) ) {
436  $callerfunc = $callers[$callerOffset + 1];
437  $func = '';
438  if ( isset( $callerfunc['class'] ) ) {
439  $func .= $callerfunc['class'] . '::';
440  }
441  if ( isset( $callerfunc['function'] ) ) {
442  $func .= $callerfunc['function'];
443  }
444  } else {
445  $func = 'unknown';
446  }
447 
448  return [ 'file' => $file, 'func' => $func ];
449  }
450 
458  private static function formatCallerDescription( $msg, $caller ) {
459  // When changing this, update the below parseCallerDescription() method as well.
460  return $msg . ' [Called from ' . $caller['func'] . ' in ' . $caller['file'] . ']';
461  }
462 
475  public static function parseCallerDescription( $msg ) {
476  $match = null;
477  preg_match( '/(.*) \[Called from ([^ ]+) in ([^ ]+) at line (\d+)\]$/', $msg, $match );
478  if ( $match ) {
479  return [
480  'message' => "{$match[1]} [Called from {$match[2]}]",
481  'func' => $match[2],
482  'file' => $match[3],
483  'line' => $match[4],
484  ];
485  } else {
486  return null;
487  }
488  }
489 
498  private static function sendMessage( $msg, $group, $level ) {
499  if ( $level !== false ) {
500  trigger_error( $msg, $level );
501  }
502 
503  wfDebugLog( $group, $msg );
504  }
505 
514  public static function debugMsg( $str, $context = [] ) {
516 
517  if ( self::$enabled || $wgDebugComments || $wgShowDebug ) {
518  if ( $context ) {
519  $prefix = '';
520  if ( isset( $context['prefix'] ) ) {
521  $prefix = $context['prefix'];
522  } elseif ( isset( $context['channel'] ) && $context['channel'] !== 'wfDebug' ) {
523  $prefix = "[{$context['channel']}] ";
524  }
525  if ( isset( $context['seconds_elapsed'] ) && isset( $context['memory_used'] ) ) {
526  $prefix .= "{$context['seconds_elapsed']} {$context['memory_used']} ";
527  }
528  $str = LegacyLogger::interpolate( $str, $context );
529  $str = $prefix . $str;
530  }
531  self::$debug[] = rtrim( UtfNormal\Validator::cleanUp( $str ) );
532  }
533  }
534 
545  public static function query( $sql, $function, $runTime, $dbhost ) {
546  if ( !self::$enabled ) {
547  return false;
548  }
549 
550  // Replace invalid UTF-8 chars with a square UTF-8 character
551  // This prevents json_encode from erroring out due to binary SQL data
552  $sql = preg_replace(
553  '/(
554  [\xC0-\xC1] # Invalid UTF-8 Bytes
555  | [\xF5-\xFF] # Invalid UTF-8 Bytes
556  | \xE0[\x80-\x9F] # Overlong encoding of prior code point
557  | \xF0[\x80-\x8F] # Overlong encoding of prior code point
558  | [\xC2-\xDF](?![\x80-\xBF]) # Invalid UTF-8 Sequence Start
559  | [\xE0-\xEF](?![\x80-\xBF]{2}) # Invalid UTF-8 Sequence Start
560  | [\xF0-\xF4](?![\x80-\xBF]{3}) # Invalid UTF-8 Sequence Start
561  | (?<=[\x0-\x7F\xF5-\xFF])[\x80-\xBF] # Invalid UTF-8 Sequence Middle
562  | (?<![\xC2-\xDF]|[\xE0-\xEF]|[\xE0-\xEF][\x80-\xBF]|[\xF0-\xF4]
563  | [\xF0-\xF4][\x80-\xBF]|[\xF0-\xF4][\x80-\xBF]{2})[\x80-\xBF] # Overlong Sequence
564  | (?<=[\xE0-\xEF])[\x80-\xBF](?![\x80-\xBF]) # Short 3 byte sequence
565  | (?<=[\xF0-\xF4])[\x80-\xBF](?![\x80-\xBF]{2}) # Short 4 byte sequence
566  | (?<=[\xF0-\xF4][\x80-\xBF])[\x80-\xBF](?![\x80-\xBF]) # Short 4 byte sequence (2)
567  )/x',
568  '■',
569  $sql
570  );
571 
572  // last check for invalid utf8
573  $sql = UtfNormal\Validator::cleanUp( $sql );
574 
575  self::$query[] = [
576  'sql' => "$dbhost: $sql",
577  'function' => $function,
578  'time' => $runTime,
579  ];
580 
581  return true;
582  }
583 
590  protected static function getFilesIncluded( IContextSource $context ) {
591  $files = get_included_files();
592  $fileList = [];
593  foreach ( $files as $file ) {
594  $size = filesize( $file );
595  $fileList[] = [
596  'name' => $file,
597  'size' => $context->getLanguage()->formatSize( $size ),
598  ];
599  }
600 
601  return $fileList;
602  }
603 
611  public static function getDebugHTML( IContextSource $context ) {
612  global $wgDebugComments;
613 
614  $html = [];
615 
616  if ( self::$enabled ) {
617  self::log( 'MWDebug output complete' );
618  $debugInfo = self::getDebugInfo( $context );
619 
620  // Cannot use OutputPage::addJsConfigVars because those are already outputted
621  // by the time this method is called.
623  ResourceLoader::makeConfigSetScript( [ 'debugInfo' => $debugInfo ] ),
624  $context->getOutput()->getCSP()->getNonce()
625  );
626  }
627 
628  if ( $wgDebugComments ) {
629  $html[] = '<!-- Debug output:';
630  foreach ( self::$debug as $line ) {
631  $html[] = htmlspecialchars( $line, ENT_NOQUOTES );
632  }
633  $html[] = '-->';
634  }
635 
636  return WrappedString::join( "\n", $html );
637  }
638 
647  public static function getHTMLDebugLog() {
648  global $wgShowDebug;
649 
650  $html = [];
651  if ( $wgShowDebug ) {
652  $html[] = Html::openElement( 'div', [ 'id' => 'mw-html-debug-log' ] );
653  $html[] = "<hr />\n<strong>Debug data:</strong><ul id=\"mw-debug-html\">";
654 
655  foreach ( self::$debug as $line ) {
656  $display = nl2br( htmlspecialchars( trim( $line ) ) );
657 
658  $html[] = "<li><code>$display</code></li>";
659  }
660 
661  $html[] = '</ul>';
662  $html[] = '</div>';
663  }
664  return WrappedString::join( "\n", $html );
665  }
666 
673  public static function appendDebugInfoToApiResult( IContextSource $context, ApiResult $result ) {
674  if ( !self::$enabled ) {
675  return;
676  }
677 
678  // output errors as debug info, when display_errors is on
679  // this is necessary for all non html output of the api, because that clears all errors first
680  $obContents = ob_get_contents();
681  if ( $obContents ) {
682  $obContentArray = explode( '<br />', $obContents );
683  foreach ( $obContentArray as $obContent ) {
684  if ( trim( $obContent ) ) {
685  self::debugMsg( Sanitizer::stripAllTags( $obContent ) );
686  }
687  }
688  }
689 
690  self::log( 'MWDebug output complete' );
691  $debugInfo = self::getDebugInfo( $context );
692 
693  ApiResult::setIndexedTagName( $debugInfo, 'debuginfo' );
694  ApiResult::setIndexedTagName( $debugInfo['log'], 'line' );
695  ApiResult::setIndexedTagName( $debugInfo['debugLog'], 'msg' );
696  ApiResult::setIndexedTagName( $debugInfo['queries'], 'query' );
697  ApiResult::setIndexedTagName( $debugInfo['includes'], 'queries' );
698  $result->addValue( null, 'debuginfo', $debugInfo );
699  }
700 
707  public static function getDebugInfo( IContextSource $context ) {
708  if ( !self::$enabled ) {
709  return [];
710  }
711 
712  $request = $context->getRequest();
713 
714  $branch = GitInfo::currentBranch();
715  if ( GitInfo::isSHA1( $branch ) ) {
716  // If it's a detached HEAD, the SHA1 will already be
717  // included in the MW version, so don't show it.
718  $branch = false;
719  }
720 
721  return [
722  'mwVersion' => MW_VERSION,
723  'phpEngine' => 'PHP',
724  'phpVersion' => PHP_VERSION,
725  'gitRevision' => GitInfo::headSHA1(),
726  'gitBranch' => $branch,
727  'gitViewUrl' => GitInfo::headViewUrl(),
728  'time' => $request->getElapsedTime(),
729  'log' => self::$log,
730  'debugLog' => self::$debug,
731  'queries' => self::$query,
732  'request' => [
733  'method' => $request->getMethod(),
734  'url' => $request->getRequestURL(),
735  'headers' => $request->getAllHeaders(),
736  'params' => $request->getValues(),
737  ],
738  'memory' => $context->getLanguage()->formatSize( memory_get_usage() ),
739  'memoryPeak' => $context->getLanguage()->formatSize( memory_get_peak_usage() ),
740  'includes' => self::getFilesIncluded( $context ),
741  ];
742  }
743 }
MWDebug\query
static query( $sql, $function, $runTime, $dbhost)
Begins profiling on a database query.
Definition: MWDebug.php:545
$wgUseCdn
$wgUseCdn
Enable/disable CDN.
Definition: DefaultSettings.php:3247
MWDebug\getDebugHTML
static getDebugHTML(IContextSource $context)
Returns the HTML to add to the page for the toolbar.
Definition: MWDebug.php:611
ResourceLoader\makeConfigSetScript
static makeConfigSetScript(array $configuration)
Return JS code which will set the MediaWiki configuration array to the given value.
Definition: ResourceLoader.php:1617
Sanitizer\stripAllTags
static stripAllTags( $html)
Take a fragment of (potentially invalid) HTML and return a version with any tags removed,...
Definition: Sanitizer.php:1576
MWDebug
New debugger system that outputs a toolbar on page view.
Definition: MWDebug.php:35
GitInfo\isSHA1
static isSHA1( $str)
Check if a string looks like a hex encoded SHA1 hash.
Definition: GitInfo.php:166
wfDebugBacktrace
wfDebugBacktrace( $limit=0)
Safety wrapper for debug_backtrace().
Definition: GlobalFunctions.php:1279
ResourceLoader\makeInlineScript
static makeInlineScript( $script, $nonce=null)
Make an HTML script that runs given JS code after startup and base modules.
Definition: ResourceLoader.php:1590
MW_VERSION
const MW_VERSION
The running version of MediaWiki.
Definition: Defines.php:36
$wgDeprecationReleaseLimit
$wgDeprecationReleaseLimit
Release limitation to wfDeprecated warnings, if set to a release number development warnings will not...
Definition: DefaultSettings.php:7417
GitInfo\headSHA1
static headSHA1()
Definition: GitInfo.php:403
MWDebug\sendMessage
static sendMessage( $msg, $group, $level)
Send a message to the debug log and optionally also trigger a PHP error, depending on the $level argu...
Definition: MWDebug.php:498
MWDebug\getHTMLDebugLog
static getHTMLDebugLog()
Generate debug log in HTML for displaying at the bottom of the main content area.
Definition: MWDebug.php:647
MWDebug\$debug
static array $debug
Debug messages from wfDebug().
Definition: MWDebug.php:48
MWDebug\getCallerDescription
static getCallerDescription( $callerOffset)
Get an array describing the calling function at a specified offset.
Definition: MWDebug.php:421
$file
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
Definition: router.php:42
GitInfo\headViewUrl
static headViewUrl()
Definition: GitInfo.php:419
MWDebug\getLog
static getLog()
Returns internal log array.
Definition: MWDebug.php:158
wfDebugLog
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
Definition: GlobalFunctions.php:958
$debug
$debug
Definition: mcc.php:31
$wgShowDebug
$wgShowDebug
Display debug data at the bottom of the main content area.
Definition: DefaultSettings.php:7368
MWDebug\getFilesIncluded
static getFilesIncluded(IContextSource $context)
Returns a list of files included, along with their size.
Definition: MWDebug.php:590
ApiResult
This class represents the result of the API operations.
Definition: ApiResult.php:35
$wgUseFileCache
$wgUseFileCache
This will cache static pages for non-logged-in users to reduce database traffic on public sites.
Definition: DefaultSettings.php:3134
$wgCommandLineMode
global $wgCommandLineMode
Definition: DevelopmentSettings.php:29
MWDebug\debugMsg
static debugMsg( $str, $context=[])
This is a method to pass messages from wfDebug to the pretty debugger.
Definition: MWDebug.php:514
MWDebug\clearDeprecationFilters
static clearDeprecationFilters()
Clear all deprecation filters.
Definition: MWDebug.php:410
MWDebug\$deprecationWarnings
static array $deprecationWarnings
Array of functions that have already been warned, formatted function-caller to prevent a buttload of ...
Definition: MWDebug.php:70
MWDebug\getDebugInfo
static getDebugInfo(IContextSource $context)
Returns the HTML to add to the page for the toolbar.
Definition: MWDebug.php:707
OutputPage\addModules
addModules( $modules)
Load one or more ResourceLoader modules on this page.
Definition: OutputPage.php:567
MWDebug\clearLog
static clearLog()
Clears internal log array and deprecation tracking.
Definition: MWDebug.php:166
MWDebug\deprecated
static deprecated( $function, $version=false, $component=false, $callerOffset=2)
Show a warning that $function is deprecated.
Definition: MWDebug.php:223
MWDebug\setup
static setup()
Definition: MWDebug.php:80
OutputPage
This is one of the Core classes and should be read at least once by any new developers.
Definition: OutputPage.php:50
ApiResult\addValue
addValue( $path, $name, $value, $flags=0)
Add value to the output data at the given path.
Definition: ApiResult.php:393
MWDebug\log
static log( $str)
Adds a line to the log.
Definition: MWDebug.php:139
ApiResult\setIndexedTagName
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
Definition: ApiResult.php:603
MWDebug\appendDebugInfoToApiResult
static appendDebugInfoToApiResult(IContextSource $context, ApiResult $result)
Append the debug info to given ApiResult.
Definition: MWDebug.php:673
$line
$line
Definition: mcc.php:119
$wgDevelopmentWarnings
$wgDevelopmentWarnings
If set to true MediaWiki will throw notices for some possible error conditions and for deprecated fun...
Definition: DefaultSettings.php:7410
GitInfo\currentBranch
static currentBranch()
Definition: GitInfo.php:411
MWDebug\init
static init()
Enabled the debugger and load resource module.
Definition: MWDebug.php:107
MWDebug\deinit
static deinit()
Disable the debugger.
Definition: MWDebug.php:116
IContextSource
Interface for objects which can provide a MediaWiki context on request.
Definition: IContextSource.php:58
MWDebug\detectDeprecatedOverride
static detectDeprecatedOverride( $instance, $class, $method, $version=false, $component=false, $callerOffset=2)
Show a warning if $method declared in $class is overridden in $instance.
Definition: MWDebug.php:257
MWDebug\filterDeprecationForTest
static filterDeprecationForTest( $regex)
Deprecation messages matching the supplied regex will be suppressed.
Definition: MWDebug.php:400
$wgDebugComments
$wgDebugComments
Send debug data to an HTML comment in the output.
Definition: DefaultSettings.php:7237
Html\openElement
static openElement( $element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
Definition: Html.php:255
Html\rawElement
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
Definition: Html.php:213
wfBacktrace
wfBacktrace( $raw=null)
Get a debug backtrace as a string.
Definition: GlobalFunctions.php:1307
MWDebug\addModules
static addModules(OutputPage $out)
Add ResourceLoader modules to the OutputPage object if debugging is enabled.
Definition: MWDebug.php:127
MWDebug\$deprecationFilters
static string[] $deprecationFilters
Deprecation filter regexes.
Definition: MWDebug.php:75
IContextSource\getRequest
getRequest()
MWDebug\formatCallerDescription
static formatCallerDescription( $msg, $caller)
Append a caller description to an error message.
Definition: MWDebug.php:458
MediaWiki\Logger\LegacyLogger
PSR-3 logger that mimics the historic implementation of MediaWiki's former wfErrorLog logging impleme...
Definition: LegacyLogger.php:51
Html\element
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
Definition: Html.php:235
MWDebug\warning
static warning( $msg, $callerOffset=1, $level=E_USER_NOTICE, $log='auto')
Adds a warning entry to the log.
Definition: MWDebug.php:182
$wgDebugToolbar
$wgDebugToolbar
Display the new debugging toolbar.
Definition: DefaultSettings.php:7594
MWDebug\parseCallerDescription
static parseCallerDescription( $msg)
Append a caller description to an error message.
Definition: MWDebug.php:475
IContextSource\getOutput
getOutput()
MWDebug\$query
static array $query
SQL statements of the database queries.
Definition: MWDebug.php:55
wfGetCaller
wfGetCaller( $level=2)
Get the name of the function which called this function wfGetCaller( 1 ) is the function with the wfG...
Definition: GlobalFunctions.php:1344
MWDebug\sendRawDeprecated
static sendRawDeprecated( $msg, $sendToLog=true, $callerFunc='')
Send a raw deprecation message to the log and the debug toolbar, without filtering of duplicate messa...
Definition: MWDebug.php:369
MWDebug\deprecatedMsg
static deprecatedMsg( $msg, $version=false, $component=false, $callerOffset=2)
Log a deprecation warning with arbitrary message text.
Definition: MWDebug.php:305
IContextSource\getLanguage
getLanguage()
MWDebug\$log
static array $log
Log lines.
Definition: MWDebug.php:41
MWDebug\$enabled
static bool $enabled
Is the debugger enabled?
Definition: MWDebug.php:62