Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.
Change-Id: Iced714bca004756b461b66067a49a925a7e3b877
This adds a new pane for the debug toolbar labeled Profiler. It groups
together events sent to wfProfileIn/Out and draws a timeline giving a
visual representation of what the page was doing at a particular point
in time. Hovering over a timeline brings up a flyout about the contained
events.
Depends on I08854d80f57286129f19cb14566f84ed3c7fa21c for proper positioning
of the flyout.
Change-Id: I23a0ce4137abcd74ad87967fb263214c08cb9685
- The parameter is now a string, making is more understandable than
boolean values
- It takes the same values in both wfDebug() and wfDebugLog() (except
for 'private' which is only used in the latter)
- This adds a new possibility to wfDebugLog() to log the message either
on the specific log or the general one, but not to the debug toolbar
- Old boolean values are still recognised for backward compatibility
- Also send the messages passed to wfDebugLog() to the debug toolbar
when they are written to a specific log and not restricted to logs
- Updated the calls of and wfDebug() and wfDebugLog() with the last
parameter to change it into a string
- Renamed MWDebug::sendWarning() to MWDebug::sendMessage() and added
$group parameter to it; will not break anything since that method
is marked as private
- Changed the call to wfDebug() from MWDebug::sendMessage() to use
wfDebugLog() with 'log' as thrid parameter, so that those messages
can be logged separately from the main log and they don't show up
a second time on the "debug log" tab of the debug toolbar
Change-Id: I1be09d4c1d3408ed5b26a5db02691c17c0ec0926
Also removed some unnecessary ones. I think I've caught them all.
The spaceless version already appears in core ~300 times (after
accounting for false positives when grepping). Some consistency would
be nice.
Change-Id: I607655b5f4366e66dc78730d5fd2f57ed8776cae
When using debug toolbar, make the result cleaner and more readable:
XML: <debugLog><msg>…</msg><msg>…</msg></debugLog>
JSON: "debugLog": ["…","…"]
Instead of current:
XML: <debugLog><msg xml:space="preserve">…</msg>...
JSON: "debugLog": [{"*": "…"}, {"*": "…"}]
Change-Id: Ieb9d3ab23d7654f5eaf3b79b3b69f4aab99d4680
The debug output might contain non UTF-8 chars. Theses bad characters
are not compatible with the debug toolbar. As a result the debug
toolbar disappears. Non UTF-8 chars are being produced by the database
log that prints out binary fields for example.
Bug: 48951
Change-Id: I42f7a5c913b378c05b68970646c75894ca068ed9
[includes/cache/MessageCache.php]
- internal constants
- constructor
- a few missing @var
[includes/clientpool/RedisConnectionPool.php]
- group internal settings applying to the pool
- misc protected members updates
[includes/debug/Debug.php]
- missing parameter name in @var statements
Change-Id: I6ff0a68d659529d128f40f32b0fd1c1d39af952f
Currently, trigger_error() is used to report non-fatal problems in
production. It seems more consistent to have our own function to do
that, with behavior consistent with wfWarn().
Change-Id: I531b7ceec089978c2832721486f277fdfca65270
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.
Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
* @licence -> @license
* Protects inline HTML by using double quotes, our inline comments uses
elements such as <h1> or <firstnameLastname@gmail.com>
* Commands in lowercase (@TODO -> @todo, @NOTE -> @note)
* removes @abstract and @static since doxygen detects them from PHP
code.
* various undocumented function parameters
* typos in parameters declarations
Change-Id: I62ad6fc124c355bf31acc780b9614a59cf79a421
- Group common code in one instead of doing checks one
time in GlobalFunctions.php and another time in Debug.php
- Remove the code catching the fact that a warning is due
to a deprecation warning, no longer needed
- Pass the caller offset from wfDeprecated() to
MWDebug::deprecated(); this was breaking deprecation
notices for global objects.
- Changed PHP error level for deprecation notices (when
$wgDevelopmentWarnings is set to true) from E_USER_NOTICE
to E_USER_DEPRECATED since we now require PHP 5.3+
- Added E_USER_DEPRECATED to wfSuppressWarnings() and
removed the check for the E_DEPRECATED constant being set
now that we require PHP 5.3+
- Fixed MWDebugTest by calling wfSuppressWarnings() and
wfRestoreWarnings() in setUp() and tearDown()
Change-Id: I6810b57c90d384de55a2cf177047767cdb734f79
- This removes the duplication of MWDebug::$debug and
OutputPage::$mDebugtext, so there's no need to store two times
the same text
- Removed OutputPage::debug() since it's no longer used
- Had to keep OutputPage::$mDebugtext because it's still
referenced by SemanticPageMaker extension
- Moved Skin::formatDebugHTML() to MWDebug::GetHTMLDebugLog()
and replaced the call in Skin::generateDebugHTML() to use it
- Also check $logonly before sending entries to the debug
toolbar in wfDebug(), for consistency
- Changed MWDebug::getDebugHTML() to also return the debug log
in an HTML comment if $wgDebugComments is set to true and
changed the location of this call to BaseTemplate::printTrail()
so that its result is the latest possible. This also includes
the debug toolbar.
- Removed MockOutputPage and related test cases since they are
no longer accurate
Change-Id: Ie0f389f8566457b1c938c627ed930040741ac9d9
which we weren't treating right.
* $limit in wfDebugBacktrace() is the number of returned frames,
we thus need to take into account the wfDebugBacktrace() frame, which
is sliced from debug_backtrace().
* wfGetCaller() needs to add a level for itself.
* MWDebug::warning() was logging itself as the warning issuer,
which is useless (the call a few lines before was right, though)
MWDebugTest.php changed accordingly.
* Removed double call to wfGetCaller( $callerOffset + 1 )
* Documented the meaning of wfGetCaller() parameter
* Added unit test
Change-Id: Ief50f4c810bad8b03bb2bf9dc6d945d9acb29851
This allow to get the queries of the api due the same api request,
when setting $wgDebugToolbar = true, that acts like the inline script
added to index.php
Change-Id: I7c121822827137ba098d95a54ec90f824e0ddf01
Now that there is a link on the revision hash in Special:Version, do the same in the debug toolbar.
Change-Id: I953ac70e17e72be68251e3908e164dfa46c68bf5
The git version is displayed for consistency with other locations where the MediaWiki version is displayed and I always the branch on which I am :)
Change-Id: Icf041eabe49f03350536f212753e46f8e3468614
* Instead of inline global variable and lazy-loading, using ResourceLoader (using mw.config and mw.loader)
* Can't use OutputPage::addJsConfigVars / OutputPage::addModules because debug is called after those are handled, using ResourceLoader::makeConfigSetScript instead
* Add the mediawiki.debug module from OutputPage::addDefaultModules() along with other modules
* Get the request information when building the JS output instead of in Setup.php
MWDebug initialization method was made to look up for a global variable. This
patch move the logic to Setup.php so we can replicate it when doing tests.
Side effect, MWDebug is disabled by default. Users will explicitly have to
enable it by using init().
Ping r105123