Thanks Mark,
So what's my best path to move forward with this? A giant diff patch that
implements Mark's version for every class? A series of small, independently
verifiable diffs? What special concerns should I take into account when
undertaking such a sweeping change (above and beyond what's on
MediaWiki.orgthat is)?
Are there reasons why this patch wouldn't be accepted that I should consider
before undertaking the work to implement it?
Thanks in advance for any advice - I know how to do the code, it's the
process of getting it into the code base where I need guidance. Thanks
again.
-- Jim
On 2/14/07, Mark Clements <gmane(a)kennel17.co.uk> wrote:
"Jim Wilson" <wilson.jim.r(a)gmail.com> wrote in
message news:ac08e8d0702140949u83cc418hd6f54fca61b1ec64@mail.gmail.com...
How do you feel about this alternative? (continuing the UploadForm
example):
function instantiate( &$request ) {
$uploadForm = NULL;
wfRunHooks('BeforeInstantiate_UploadForm', array( &$uploadForm,
&$request ));
if ($uploadForm != NULL) {
return $uploadForm;
}
$uploadForm = new UploadForm($request);
wfRunHooks('AfterInstantiate_UploadForm', array( &$uploadForm,
&$request
));
return $uploadForm;
}
AfterInstantiate_X should be run regardless of where the object came from.
The above should probably be (in some kind of pseudo-code form):
function instantiate( &$args) {
$objResult = NULL;
wfRunHooks('BeforeInstantiate_X', array( &$objResult, &$args));
if ($objResult === NULL)
$objResult = new Object($args);
wfRunHooks('AfterInstantiate_X', array( &$ojResult, &$args));
return $objResult;
}
- Mark Clements (HappyDog)
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
http://lists.wikimedia.org/mailman/listinfo/wikitech-l