Commit graph

46 commits

Author SHA1 Message Date
aude
aabf9345f0 Fix uncaught ApiFormatXml exception with api debuginfo
Also added tests to cover this.

Bug: 67246
Change-Id: Ifb2e392d3277a4702832727f70c77b170d4b2bf5
2014-06-28 20:35:52 +02:00
umherirrender
b45420410f Fixed some @params documentation (includes/*)
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
2014-04-19 22:22:20 +02:00
Erik Bernhardson
49abc169d7 Better memory reporting when running in HHVM
Change-Id: If06b7b3ff4dc7ba8b873361f7878f8abb718f571
2014-04-02 22:04:32 +00:00
Erik Bernhardson
99aef03f04 Visualize profile output in debug toolbar
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
2014-04-02 21:53:51 +00:00
Alexandre Emsenhuber
a7a0883019 Enhance the destination control parameter of wfDebug() and wfDebugLog()
- 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
2014-02-04 19:56:24 +00:00
Siebrand Mazeland
40577be3dd Replace deprecated <tt> with <code>
Change-Id: I4d80b2eff87c9ddaa4439c83aea21c73fca0d68c
2013-11-20 17:21:31 +01:00
Siebrand Mazeland
6e938b08ba Break long lines in MWDebug class
Change-Id: I65a080f8024a79e6e6b4ccc39e457b26d3637cf7
2013-11-20 15:03:00 +01:00
MatmaRex
df8ec1e216 No spaces after (casts)
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
2013-09-04 20:05:43 +02:00
Yuri Astrakhan
8dcf1e6205 API DebugToolbar's debugLog format cleanup
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
2013-07-09 22:03:16 -04:00
physikerwelt
567407d21e Remove non UTF-8 chars from debug output
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
2013-06-06 18:47:41 +00:00
Antoine Musso
43ae2fb6f9 doc: various updates
[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
2013-05-20 12:02:37 +02:00
umherirrender
892ee7a4af Fixed spacing in db/debug/diff/externalstore/objectcache folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: I32a43c547630ce31b6b25cc1bc9eedc50e67b2d7
2013-04-20 22:28:52 +02:00
daniel
aacdbbc6f3 Adding wfLogWarning for production warnings.
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
2013-03-19 15:24:00 +00:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
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
2013-03-11 13:15:01 -04:00
Antoine Musso
9362bb6c56 miscellaneous doxygen warnings
* @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
2012-10-22 14:00:08 +02:00
Alexandre Emsenhuber
5af2159512 Moved warning stuff into MWDebug class.
- 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
2012-08-28 15:33:44 +02:00
Alexandre Emsenhuber
61dd1d037b Use the MWDebug class to display debug log back in the request.
- 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
2012-08-27 23:47:19 +02:00
umherirrender
25ce55175d output errors as debug info in api, when display_errors is on
With format=xml errors never outputted, only in the html version

Change-Id: I4364cee041ea42ed3a4ab43ac77a1ba3cc2cb886
2012-08-14 22:00:04 +02:00
Alexandre Emsenhuber
53b3c82fd7 Added WebRequest::getMethod() to get the HTTP method of the request.
This is to replace the usage of $_SERVER['REQUEST_METHOD'].

Change-Id: I45084254c5452b00b0665df78628cfd214e39cab
2012-08-07 18:28:43 +02:00
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Platonides
2e506c4809 PHP >= 5.4.0 started taking advantage of $limit optimization of wfDebugBacktrace(),
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
2012-05-31 17:32:33 +02:00
Reedy
5b4e4a06c7 Merge "add since tags" 2012-05-16 23:48:49 +00:00
jeroendedauw
6e9ca6e285 add since tags
Change-Id: I4601600f3d0de79c34f5a1a4074384b27f57b005
2012-05-16 18:27:17 +02:00
umherirrender
0a5e1bf76a Add DebugInfos to api result
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
2012-05-13 11:20:04 +02:00
Alexandre Emsenhuber
e7ab34cf1d Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: If65d7313e1e05163ce6cc46d17daa310cb41888c
2012-04-28 20:41:55 +02:00
Alexandre Emsenhuber
17ccccda2a Follow-up I5b02aa914916f64492c85ce6dcc3272b6406551a (#4335), also put a link in the debug toolbar.
Now that there is a link on the revision hash in Special:Version, do the same in the debug toolbar.

Change-Id: I953ac70e17e72be68251e3908e164dfa46c68bf5
2012-04-10 22:44:26 +02:00
Alexandre Emsenhuber
b5cf42e8b8 Show the git revision and git branch in the debug toolbar if available.
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
2012-03-28 21:37:30 +02:00
Krinkle
05e1140cf7 [mw.debug] Clean up
* 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
2012-02-13 15:25:08 +00:00
Sam Reed
76246b9bf5 More return documentation 2012-02-09 21:33:27 +00:00
Alexandre Emsenhuber
96b0739ffb Fix typo so that the key is set with correct value instead of a boolean with key "0" 2012-02-08 22:41:11 +00:00
Alexandre Emsenhuber
a172d738eb Recommit r110758 (again) now that the problem has been fixed in r110761 2012-02-06 17:34:33 +00:00
Antoine Musso
5912473690 reverts r110488
Breaks maintenance/rebuildFileCache.php with stack trace saying that
FauxRequest::getRequestURL() not implemented

Backtrace:
#0 includes/WebRequest.php(1261): FauxRequest->notImplemented('FauxRequest::ge...')
#1 includes/debug/Debug.php(266): FauxRequest->getRequestURL()
#2 includes/Skin.php(561): MWDebug::getDebugHTML(Object(RequestContext))
#3 includes/SkinTemplate.php(461): Skin->generateDebugHTML()
#4 includes/OutputPage.php(1982): SkinTemplate->outputPage()
#5 maintenance/rebuildFileCache.php(119): OutputPage->output()
#6 maintenance/doMaintenance.php(105): RebuildFileCache->execute()
#7 maintenance/rebuildFileCache.php(146): require_once('/srv/trunk/main...')
#8 {main}
2012-02-06 16:42:58 +00:00
Alexandre Emsenhuber
afab06cc73 wfTime() -> microtime( true ), no need to use the former which is just a wrapper to the latter 2012-02-03 08:32:34 +00:00
Alexandre Emsenhuber
4d9259d36d Recommit r109062 (Only run some MWDebug code when really needed) but leaving the addition of ResourceLoader module inside the MWDebug class this time 2012-02-01 15:48:12 +00:00
Aaron Schulz
8d5837cc27 Reverted r109062 per code slush (also has a CR complaint) 2012-01-19 02:26:10 +00:00
Alexandre Emsenhuber
7e16cba902 Only run some MWDebug code when really needed:
* 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
2012-01-16 21:29:05 +00:00
Antoine Musso
ff39c31a97 Move MWDebug enabling logic to 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
2012-01-16 13:44:46 +00:00
Antoine Musso
6fdbefa521 MWDebug: avoid double count()
Follow r107954
2012-01-13 23:10:21 +00:00
Antoine Musso
0f02086990 some tests for MWDebug
Really incomplete. We need better testing.

Added two new public methods so we can get or clear the internal logs.
2012-01-13 23:07:52 +00:00
John Du Hart
c1f84a7a64 Followup r107954, rm debugging code 2012-01-03 23:52:15 +00:00
John Du Hart
9a96f9f323 Followup r107862
Fix bug that caused a PHP notice
Vertical-align:top on callers in the console
2012-01-03 22:36:35 +00:00
John Du Hart
7e9d750cc7 Implemented console panel in debug toolbar 2012-01-03 05:56:36 +00:00
John Du Hart
e09029f654 Using wfTime in place of microtime 2012-01-03 04:02:35 +00:00
John Du Hart
f12c373d1e Followup r105122 & r105123, fixes and improvements per CR
Using Language::getSize per Nikerabbit
Cleanup HTML generation per brion (yay)
2011-12-15 02:26:14 +00:00
John Du Hart
33df266958 svn:eol-style native on all phase3 stuff, since I messed that up in r105122
Also adding the MWDebug class I missed there as well
2011-12-04 18:35:40 +00:00