At 3/3/2005 03:02 PM, Rowan Collins wrote:
Note that the skin is stored as a member of the User object, and "got" from there whenever it's needed (i.e. all over the place). So you couldn't just change the code in one place where it's retrieved, you'd have to change it in User::getSkin itself (which seemingly loads the option on first request), or override the member variable in some other way
You got me, that's what I was planning to do :) Save it somewhere, override it, then restore it. Evil, but it's a small website. I thought OutputPage::output() would be the right place to do it, but you are right, I just grepped for ->getSkin(), and it's scary how many times it is invoked. I would have to test exactly where a hook would solve my problem, but feel free to put one in ::output() already, I'm pretty sure it would be useful. Or is 1.4 already released ?
This is actually even more important because of the way you implemented the pattern: it seems the event/hook signature is not "frozen": each event/hook can have a different number of arguments attached to it. So unless I'm wrong, any change made to an event/hook signature in the MediaWiki code will break people's hooks. In C++, we "avoided" that problem by passing a void* (that you would cast to whatever, int*, float*, object*, etc).
I thought that when I first heard of the hooks system. Wouldn't it be better to pass an associative array,
You are right, I did not think about it, associate arrays would have been nice. Did you guy freeze that feature already ?
-- Sebastien Barre