From: Jeff D. <da...@da...> - 2001-11-21 17:38:51
|
On Wed, 21 Nov 2001 11:11:03 -0500 "Joe Edelman" <jo...@or...> wrote: > Page metadata > will be able to handle much of this too, but there's no way to SELECT on > page metadata efficiently, right now. Still thinking. Yes, this is problem. I've got vague notions of adding an API to WikiDB to allow the addition of arbitrary "indexes" or something. (Think about want to add new and experimental page "score" algorithms.) It would be nice to abstract the process away from the SQL model. I haven't come up with a clean way to do this yet. > Okay. But I'm going to do an unregister function too, so that hacks like > this work: > > $em->register( 'onWikiLinkDetectedInTransform', 'add_to_links_array', > $pagename ); > do_transform( $pagetext ); > $em->clear( 'onWikiLinkDetectedInTransform', 'add_to_links_array' ); The main reason I proposed the $key argument to WikiTimerManager::registerTimer, is to provide for clean identification of handlers when one wants to unregister it. Adding a (perhaps optional) $key argument to $em->register would probably be a good idea. (Or perhaps better, though it's yet another different API, have $em->register return a key or handle while can be used to unregister the callback.) And, in case I didn't mention it before, it's probably time to implement WikiCallback as a bona fide class. There are already a number of places where callbacks are passed around. class WikiCallback Constructor: new WikiCallback($globalFunctionName) new WikiCallback($object, $methodName) Methods: $cb->call([$args [,...]]); $cb->call_array($arrayOfArgs); $cb->getPearCb(); Returns Pear style callback: either a string for a global func, or an array of length two for an object method callback. In fact, if I find time this morning, I'll try to code it up. Jeff PS. I'll be gone for Thanksgiving, so if I'm silent, that's why. |