From: Arno H. <aho...@in...> - 2000-07-04 20:42:46
|
Hi all, ever since Steve forwarded Ari's email to the list I've been thinking about restructuring phpwiki. Here are some thoughts/questions: - the db interface will become very large. I realized that when I added functions for MostPopular. For every such query we need two new functions. I don't like this. Possible solution: all search functions return a $pagehash array. For some searches the hash may only be sparsely populated, e.g. when doing a title or mostpopular search, it's unnecessary to set $pagehash['content']. There could be one general NextMatch function in this case. For the DBM interface that might be impossible - maybe that function has to have a switch() structure of some kind. - template facility: wouldn't it be neat to be able to add new placeholders and their functions by simply including a program file with that additional functionality? this can either be done by having those placeholders and functions added to an array or by implementing them as objects: a base-class for placeholders, which contains the name of the placeholder and a function call. That function call is overloaded by actual implementations of placeholder-objects. A template class that does the translation from $content to $html. Placeholder objects register with that class, and then get called from there. - the same could be used for wiki_transform. Maybe the array (class) also has to provide priorities, so that some functions are executed before others are. The above would implicitly define APIs for phpwiki modules. The actual core could be reduced in size, while modules could simply extend the functionality by adding their functions to provided hooks. This needs some discussion first, as it would be a major modification, but I think it's Very Nice (tm). I think Ari came up with something similar (more or less), so we could learn (read: copy ;o) a lot from his code. What do you think? /Arno |