On Mon, Apr 4, 2011 at 6:06 PM, Daniel Friesen lists@nadir-seen-fire.comwrote:
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.
I was about to go "nooooo!" because mixed static/nonstatic functions throw deprecation warnings these days, but I see you've done this by separating the classes entirely and using a magic __call handler on Skin to forward the calls, neatly sidestepping the issue and avoiding writing a bunch of stubs. Yay!
That should work, but feels a little icky. :D But if it's just for back-compat and we're migrating code over, then that's probably not a problem... Main thing to keep in mind is that exceptions thrown from a __call function for unknown stuff will act differently from the fatal error you otherwise get from misspelling a function name, as exceptions are catchable etc. This can sometimes lead to surprises.
We also lose the documentation comments on the functions as they're currently used on Skin, but if that's being deprecated, not too big a deal.
A bigger worry: DumpHTML's SkinOffline overrides makeBrokenLinkObj to change behavior (looks like it never got updated to override link()'s behavior for broken-link case?). Looks like that might need to be updated to use BeginLink/EndLink hooks or something... but I'm not sure how good a shape DumpHTML's in right now, it might need many more such fixes.
-- brion