Current configuration on the wiki
Find a file
Timo Tijhof 2bea123495 MWDebug: Add support for native PHP warnings to "Console"
== Change ==

Remove integration from MWDebug methods in favour of capturing
messages from the 'error' channel. This way we fix the following
that we were all blind to:

* PHP built-in errors for native notices and deprecation warnings.
* trigger_error calls from our own code such as in standolone libs,
  where we can't use wfLogWarning or wfDeprecated, and instead use
  E_USER_WARNING and E_USER_DEPRECATED instead.
* trigger_error calls from third-party Composer libraries, which
  similarly can't and don't know about these at all.

I removed support for including a backtrace. XDebug does a better job
of this nowadays, and the information is also available in
mw-error.log already in a more readable manner. Cramming it into a
100px scrollable area made the "Console" tab much less readable in
my opinion. To make it work, we'd need to duplicate the pretty
string formatting code of wfBacktrace() and make it re-usable when
given only a trace array (rather than capture a new backtrace). I
considered re-using MWExceptionHandler::prettyPrintTrace but that is
far more verbose than the string format in wfBacktrace. Creating yet
another untested error pretty print function seemed not worthwhile
as imho in the majority of cases the $caller suffices, and when not,
the toolbar suffices as a nudge to take a look in mw-debug.log, or
check XDebug display_errors, or engage an IDE.

== Test plan ==

1. Add the following to MediaWiki.php#main() as example:
   ```
   wfLogWarning('Hello');
   wfDeprecated('Something');
   trigger_error('Goodbye');
   $x = []; $a = $x['a'];
  ```
2. Before this change, your native display_errors=1 or XDebug shows
   all four. With $wgDebugToolbar enabled, the "Console" tab
   showed only the wfLogWarning and wfDeprecated entry.
3. After this change, all four are included

Change-Id: I62d864823ec8ab9b940aae0e0f47b47a728ba861
2023-10-19 17:13:12 -07:00
.phan Merge "Add tests for taint-check" 2023-09-25 15:30:27 +00:00
cache
docs Merge "db: Allow describing table creation via abstract schema change" 2023-10-11 10:35:53 +00:00
extensions
images
includes MWDebug: Add support for native PHP warnings to "Console" 2023-10-19 17:13:12 -07:00
languages DifferenceEngine: Add user meta information on diff pages 2023-10-17 15:48:54 +00:00
maintenance Merge "Make ParsoidOutputAccess a wrapper over ParserOutputAccess" 2023-10-16 09:11:27 +00:00
mw-config
resources MWDebug: Add support for native PHP warnings to "Console" 2023-10-19 17:13:12 -07:00
skins
tests MWDebug: Add support for native PHP warnings to "Console" 2023-10-19 17:13:12 -07:00
.dockerignore
.editorconfig
.eslintignore
.eslintrc.json
.fresnel.yml
.gitattributes
.gitignore
.gitmessage
.gitreview
.mailmap mailmap: Update .mailmap and CREDITS 2023-10-09 14:07:15 +00:00
.phpcs.xml Bump codesniffer to 42.0.0 2023-09-27 15:06:32 -04:00
.stylelintrc.json
.svgo.config.js
.vsls.json
api.php
autoload.php Refactor ParserOutput::getText into DefaultOutputTransform service 2023-10-16 13:11:38 +02:00
CODE_OF_CONDUCT.md
composer.json Add wikimedia/json-codec 2.2.1 2023-10-13 11:05:46 -04:00
composer.local.json-sample
COPYING
CREDITS Prepare active branch following REL1_41 cut, labelling as 1.42-alpha 2023-10-09 22:11:03 -04:00
DEVELOPERS.md
docker-compose.yml
FAQ
Gruntfile.js
HISTORY Prepare active branch following REL1_41 cut, labelling as 1.42-alpha 2023-10-09 22:11:03 -04:00
img_auth.php
index.php
INSTALL Prepare active branch following REL1_41 cut, labelling as 1.42-alpha 2023-10-09 22:11:03 -04:00
jsduck.json resources: Remove jquery.color, jquery.fullscreen, and jquery.form 2023-10-07 01:46:09 +00:00
load.php
opensearch_desc.php
package-lock.json
package.json
phpunit.xml.dist phpunit: Determine what extensions to load in unit tests via config 2023-09-25 23:03:48 +00:00
README.md
RELEASE-NOTES-1.41 ResourceLoader: Update wikimedia/minify to 2.5.1 2023-10-12 21:06:13 -07:00
RELEASE-NOTES-1.42 Merge "Deprecate Vuex in favor of Pinia" 2023-10-18 00:44:08 +00:00
rest.php
SECURITY
thumb.php Use Authority in thumb.php 2023-10-06 17:13:18 +00:00
thumb_handler.php
UPGRADE

MediaWiki

MediaWiki is a free and open-source wiki software package written in PHP. It serves as the platform for Wikipedia and the other Wikimedia projects, used by hundreds of millions of people each month. MediaWiki is localised in over 350 languages and its reliability and robust feature set have earned it a large and vibrant community of third-party users and developers.

MediaWiki is:

  • feature-rich and extensible, both on-wiki and with hundreds of extensions;
  • scalable and suitable for both small and large sites;
  • simple to install, working on most hardware/software combinations; and
  • available in your language.

For system requirements, installation, and upgrade details, see the files RELEASE-NOTES, INSTALL, and UPGRADE.

MediaWiki is the result of global collaboration and cooperation. The CREDITS file lists technical contributors to the project. The COPYING file explains MediaWiki's copyright and license (GNU General Public License, version 2 or later). Many thanks to the Wikimedia community for testing and suggestions.