[pmwiki-users] wikifarm question: autoconfigure a new wiki

John Rankin john.rankin at affinity.co.nz
Thu Aug 24 18:27:57 CDT 2006

Is it possible to change the use of 'local' when loading 
config.php and pgcust's Group.php and Group.Page.php files, 
to use a variable such as $localDir? $localDir would default 
to 'local'.

Thanks in advance for any advice.

We are upgrading a PmWiki 1 farm that was configured with a 
local customisation so that adding a new wiki (field) to the 
farm simply involves adding its name to a list on a WikiFarm 
page. No server-side administrator intervention is needed 
unless the wiki needs its own local customisations. The 
administrator edits the WikiFarm page and adds a new wiki 
to the list.

In migrating this site to PmWiki 2, we'd like to move to a
standard wiki farm, while retaining the ease-of-use in 
setting up new wikis within the farm. Most of what we 
currently do as a local customisation can be done natively 
in PmWiki 2.1.

Current thinking
If we set up a structure like this:

    the central wiki
    and so on

then we can set up a wikifarm/ directory and an index.php. 
A simple local customisation can extract the local wiki 
(field) name from the url, check that this is a valid wiki 
name, and set $wikiDir and $uploadDir. And it will just work. 

The problem
I can't see a way to deal with each wiki's local/ directory 
and any field-specific customisations. I see 3 options:

a. wikifarm/ contains Field1.local/, Field2.local/ and so on

   field-specific customisations go in the appropriate
   Fieldn.local/ directory

b. wikifarm/ contains local/ and local/ contains Field1/,
   Field2/ and so on

   field-specific customisations go in the appropriate
   local/Fieldn/ directory

c. wikifarm/ contains local/ and local/ contains
   Field1.config.php, Field1.Group.php, Field1.Group.Page.php
   and so on

   field-specific customisations go in the local/ directory,
   with a Fieldn. filename prefix

In options a and b, the administrator would create the required 
directory at the time a local customisation is needed.

Proposed solution
We could implement either option a or option b if PmWiki let us 
set a $localDir variable instead of requiring us to use 'local'. 
The changes to pmwiki.php and pgcust.php are trivial. Current 
installations would not be affected.

I can't think of a reason to prefer option c, so am happy to
eliminate it to simplify the PmWiki changes.

Is there another, perhaps better, solution?

Would changing 'local' to a variable have any unexpected or 
undesirable side-effects?

Has anybody done something like this?
John Rankin

More information about the pmwiki-users mailing list