Quite possibly one of the coolest hooks to exist in MediaWiki. I’ve been playing with this for the past few days, and it really is indeed a powerful hook. Occurring very near the beginning of a MediaWiki execution, it allows some high-level access to early objects, before MediaWiki has begun its output.

  • $output – The global OutputPage object allowing you to control all aspects of page output prior to execution–and if you’re halting execution, you can provide your own output.
  • $article – The Article object, which could be Article, ImagePage, or CategoryPage (potentially a SpecialPage or child?)
  • $title – Your Title object. Very easy to allow for Title swapping at a very high-pre-output level.
  • $user – The current User object
  • $request – Just the WebRequest so you don’t have to call the global yourself.
  • $wiki – The MediaWiki object. Not a huge amount of use that I’ve seen yet, but it is helpful to have on hand :)

I’m really starting to see what all this baby can do :)