I would like to get to a one statement event. I don't much like the idea of requiring,
$evt = new event(...) $evt->trigger(...) or $evt->advise(...)
maybe that would require a function wrapper. A function wrapper would have the added advantage of including an unset($evt) as well.
My only issue with always signalling an *_after advise is trying to keep the system as light weight as possible. Signalling an after event when there has been no action seems superfluous, but assuming yall handlers have registered for the _before event means the addition of one function call, one conditional check and one function return, which isn't onerous.
I think your example is disingenuous, as my point was the event had to have no meaningful result or no meaningful effect. Deleting a page and creating a page have meaningful effects. Signalling "DOKUWIKI_START" has no action and therefore no meaningful effect so an _after advise has no real meaning, excepting it comes after the _before advise. But then maybe that in itself is meaningful enough, or maybe the event should be constructed differently to pair it with DOKUWIKI_END and have it ignore preventDefault.
That would in general make the format
<reference to dokuwiki location>_<noun referring to data>_<verb referring to event action or past tense of a particular state>. I guess the reference to the dokuwiki location isn't necessary, but it could be a handy convenience.
For me capital letters tend to imply constants in code. I'd prefer event names to be case sensitive simply because it avoids some extra string handling. But if consensus is one more str_toupper or str_tolower in the event constructor is no problem (and I guess we are talking miniscule numbers of microseconds), case insensitivity shouldn't be a problem.
Regards, Ben Coburn
------------------- silicodon.net -------------------
-- DokuWiki mailing list - more info at http://wiki.splitbrain.org/wiki:mailinglist