Панель отладки

This page is a translated version of the page Debugging toolbar and the translation is 62% complete.

Панель отладки — утилита для разработчиков, показывающая отладочную информацию о странице MediaWiki внизу окна браузера. Она может быть активирована переменной $wgDebugToolbar в LocalSettings.php:

$wgDebugToolbar = true;

Панель

Панель содержит несколько раскрываемых разделов

 

Это такие разделы как:

Console
An area where MediaWiki code can write messages. Superior to echoing text to the browser.
Queries
A list of SQL queries executed on that page, with timing (requires $wgDebugDumpSql ).
Debug log
A list of the debug messages printed during the page execution.
Request
HTTP request information.
PHP includes
A list of included PHP files during the page execution.
The rest
Statistics about the software versions, execution time, and memory used.

Открыть любой раздел и посмотреть данные. Закрыть нажатием. Использовать функцию поиска в браузере для поиска данных.

Ссылки на сайты MediaWiki и PHP (https://www.mediawiki.org и https://php.net)

Запись сообщений из консоли в лог

Смотри файл includes/debug/MWDebug.php для определения доступных функций. Некоторые примеры:

use MWDebug
Load the module at the top of your file before calling any functions.
MWDebug::init()
Must be called first to enable most other functions
MWDebug::log('your message here')
Отправить произвольное сообщение в консоль
MWDebug::warning('Never do that again')
Отправить сообщение об ошибке в консоль
MWDebug::deprecated('Function Foobar() is dead')
Отправить сообщение в консоль об устаревшей функциональности, включая отладочную информацию
MWDebug::queryTime(MWDebug::query('select foo from bar'));
Execute the given SQL and report its time in the Queries section.