[Pmwiki-users] How best to develop a wiki farm

Patrick R. Michaud pmichaud
Tue Mar 16 10:22:02 CST 2004


On Fri, Mar 12, 2004 at 01:25:21PM +1300, John Rankin wrote:
> We are starting to make a way to develop a collection of related 
> wikis (a farm as a collection of fields), all sharing the same 
> code and core pages, but able to act independently. 
> [...]
> pmwiki/
>     pmwiki.php
>     scripts/
>     wikilib.d/
>     pub/
>     local/
>     wiki.d/    #maybe, maybe not
>     uploads/   #maybe, maybe not
>     field.a/
>         wiki.d/
>         pub/
>         local/
>         uploads/

In this case I think I would've taken a slightly different approach
to the directory structure---choosing instead:

pmwiki/
    pmwiki.php
    scripts/
    wikilib.d/
    pub/
      field/     
    local/
      field/     
    wiki.d/    
      field/
    uploads/ 
      field.Group/  or field/Group/

My thinking on this is that there may not be a lot of need for separate
field.a/ directories in pub/ and local/, and we probably don't want a
field's pub and local directories automatically created or owned by the
webserver process anyway.  Plus in this approach we don't have to keep 
global write permissions on the pmwiki/ directory to be able to 
create the field/ subdirectories.

The basic logic would go as follows:  If we detect that we're in
a field of the farm, defined by the $Field variable being somehow
set in config.php, then

1. $WikiDir is set to 'wiki.d/$Field' 
      (automatically created if wiki.d/ exists and is writable)
2. $UploadDirFmt is set to 'uploads/$Field'
     -or-
   $UploadPrefixFmt is set to '/$Field.$Group/'
   (both with corresponding changes to $UploadUrlFmt)
3. A local pgcust.php algorithm is used to read local customizations 
   from the local/field directories in addition to the default local/ 
   scripts.  Or, it can be made "instead of the default local/ scripts" by
   setting $EnablePerGroupCust=0.

How a field is chosen (based on URL, domain name, cookie, or some other 
criteria) can be left to the wiki administrator to decide in local/config.php.

Overall, I like it.  I can envision a wikifarm script along these
lines becoming part of the standard PmWiki distribution.

Pm



More information about the pmwiki-users mailing list