On 05.04.2011 5:06, Daniel Friesen wrote:
Continuing with my changes to $wgOut, $wgUser, Skin, and SpecialPage patterns.
The Linker is now static, $sk->link will still work, however you should not be requiring a Skin anymore to use linker methods. Please use Linker::link directly. The only exception is the method to create an editsection link, that method IS part of Skin itself now. Also there is some compat for hooks that were passed the linker as an instance, and `$parserOptions->getSkin();` However note that ParserOptions::getSkin no longer returns an actual Skin, it now returns a plain linker instance and makes a depreciated call. ((for reference the 'instance' of Linker which is static is actually a "DummyLinker" class which has a __call that forwards old method calls to static calls to the linker))
So nearly EVERY case you are currently grabbing a Skin for, you should no longer be fetching a skin.
Now, if you really do need a skin, the the new way to get a skin is `$context->getSkin()`, OutputPage has a helper `$out->getSkin()` if you happen to be working on OutputPage related stuff and need to interact with the skin. `$wgUser->getSkin();` has some BackCompat to keep working, however please avoid using it, it uses the main RequestContext, not whatever the RequestContext for whatever context you are in is.
Also, there is no equivalent to `$wgUser->getSkin( $title );`. Skin no longer has a mTitle of it's own, it gets the title used in the attached RequestContext, which is the same one that OutputPage uses, and is essentially the replacement to $wgTitle. So you don't need to work around bugs like that in Skin, nor in OutputPage anymore. Additionally that format was never actually used right, nearly every call to that was actually made in contexts where one was using the Linker methods (which don't use mTitle) and was not interacting with the skin.
I started a page on the RequestContext object: http://www.mediawiki.org/wiki/Request_Context
Context is very interesting. That sounds like easier way of having farms sharing one installation path without the symlink hacks, also probably an efficient "in-farm transclusion". Dmitriy