Jump to content

Requests for comment/Third-party components

From mediawiki.org
Request for comment (RFC)
Third-party components
Component General
Creation date
Author(s) Tyler Romeo
Document status in draft

Introduction

[edit]

MediaWiki contains a number of bare-bones components made to fit specific needs in core. Some examples of these are logging using wfErrorLog, sending HTTP requests using the HttpFunctions class, etc. In each of these cases, just barely enough functionality was implemented to fit the needs of the application, and a lot of the time the code goes unmaintained so long as it keeps working.

At the same time, other open source projects have created entire libraries that do the same thing as the MediaWiki components, except are better maintained and much more functional. This RFC aims to replace one or more MediaWiki components with third-party open source components.

Possible replacements

[edit]
MediaWiki component Replacement library Difficulty Functionality advantages / disadvantages
HttpFunctions Guzzle Easy
  • RFC-compliant support for caching, cookies, and URL templating
  • Integration with PHP streaming API
UserMailer Swift_Mailer Easy
  • More transport destination options
  • Support for failover (bug 46640?)
wfErrorLog / wfDebug / wfDebugLog Monolog Medium
  • Logs to pretty much everything (syslog, files, UDP socket, email, database, the browser)
  • Allows different logging formats (HTML, plaintext, etc.)
MediaWiki's global variable configuration Symfony Config Hard Need I say any more
WebRequest / WebResponse Symfony HttpFoundation Hard
  • More abstractions for HTTP headers
  • Easier mocking of fake requests
  • Better object-oriented abstraction of Response objects
  • Might not integrate well with File Upload system
  • Using the Response class requires more integration with OutputPage
wfShellExec Symfony Process Incompatible
  • Allows asynchronous process execution
  • Is not integrated with logging system like wfShellExec is
  • Does not have memory or CPU limits like wfShellExec does
HTMLForm Symfony Validator Medium
  • Not a replacement, but a supplement; Validator only does one part of HTMLForm
  • Has a lot more validation filters built in
Maintenance Symfony Console Medium
  • Handles different verbosity levels
  • Allows for console coloring
  • Supports sub-commands

See also

[edit]