On 11-04-05 02:16 PM, Brion Vibber wrote:
On Mon, Apr 4, 2011 at 6:06 PM, Daniel Friesenlists@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
- Overrides a linker method - Uses deprecated poweredbyico and copyrightico - Is completely out of date as a skin, no use of headelement, footerlinks, blah, blah, blah... - Overrides the method generating content_actions instead of using content_navigation - Creates an OutputPage instead of using RequestContext
I don't really like the fact that DumpHTML handles skin stuff by copying Monobook and making some overriding hacks in it. I'm starting to thing we should drop SkinOffline, create an offline/dump/static render mode inside skin or outputpage to be used to make some of the minor tweaks to skin markup relevant to static outputs, and make DumpHTML work by setting that offline mode, making calls to OutputPage to alter what scripts/styles are loaded, and using hooks to alter the behaviour of links made from the linker. And as a bonus: - We won't have to modify a clone of MonoBook anymore - And we'll be able to make dumps from any skin you want, including Vector, Modern, or any custom skin you build.
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]