From: Alex B. <en...@tu...> - 2001-08-20 23:24:37
|
> > i thought i'd be the first to report that the Query_Example no longer > works after this last CVS sync. > > Warning: Supplied argument is not a valid MySQL result resource in > /home/jason/r2/binarycloud/build/en/ext/metabase/metabase_mysql.php on > line 166 hrm... I haven't tested any of this, I'll do that and see what I see. andreas? > as for the document root side, i have a question as to handle this. i > know either way will work, but i'm wanting to stay as conforming as > possible while BC is still under development. > > should i have this...: > build/en/htdocs/forum/index.php <- builds/imports > build/en/htdocs/forum/list.php <- builds/imports ForumList.php > build/en/htdocs/forum/read.php <- builds/imports ForumRead.php > . > . > etc. > which is working fine, although all the gPageDef is redundant. > > OR this...: > build/en/htdocs/forum/index.php <- a switch looking for $mode which > builds/imports the desired module such as ForumIndex.php,ForumList.php, > etc... > > this seems like a trivial question to ask, but i'm not exactly sure how > module distribution is to be handled in the future. > > i hope this is clear enough for a response. yes, it is. One of the things I would like to do is build a "PageDefBuilder" class which is capable of accepting some rules from a 'definition file' so you could do something like this: setup an alias for htdocs/forum/* to htdocs/forum/index.php, which would allow you to receive requests like forum/post/1928374. The page in htdocs/index.php would not contain module definitions: it would import PageDefBuilder, which would import a file from your module dir which tells it how to build up the module list (in this case, based on the request uri), put that array into $gPageDef - then import & run Page->BuildPage(); That would make your urls elegant (you can parse the request uri into an array which will tell you what modules to use, and still retain the ability to cache those module's output) ------ That's sort of fancy, but it makes your 'external face' to the world very orderly and clean (and if your forums are public, search engine friendly, not to mention easily memorable and bookmarkable. Barring the above, the other way, i.e. a separate page with some duplicative $gPageDef stuff is I think the best way to go. If you're into it, you're welcome to build a PageDefBuilder class :) I'll help :) best, _alex |