[pmwiki-users] Wikifarm question

Patrick R. Michaud pmichaud at pobox.com
Mon Sep 11 08:03:18 CDT 2006


On Mon, Sep 11, 2006 at 11:38:01AM +1200, John Rankin wrote:
> On Saturday, 9 September 2006 4:49 AM, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> >On Fri, Sep 08, 2006 at 05:06:42PM +1200, John Rankin wrote:
> >> We do ths by temporarily resetting $WikiDir to point to 
> >> the appropriate field's wiki.d. 
> >
> >As a quick aside: Something about this approach is causing 
> >alarm bells to ring in my head, but I can't put my finger 
> >on exactly why.  For now let me just note that the idea of
> >swapping $WikiDir in the middle of processing is *way* outside
> >of my mental design spec, so I can't be certain that something
> >won't break later on.
> 
> I understand the alarm bells; I hear them too. The reason we
> have ignored them for the time being is:
> - we couldn't see another way to implement this feature and
>   administering an entire farm from a single Site.WikiFarm
>   page is very tidy

How about a custom LinkFieldPage() function that works just like
LinkPage() but checks for page existence in another field?
Instead of using PageExists(), one can do $fielddir->exists($pagename) .

> - we are actually more worried about having to reset $WorkDir
>   to the selected field's wiki.d when we detect a request to
>   browse or edit a page in a given field, as we are changing 
>   where pmwiki writes its lock file -- we are pretty sure this
>   is OK, but could be wrong

There's a potential conflict here if two people attempt to 
simultaneously edit the same page from different fields where
different lockfiles are being used.  

One simple way to avoid this is to have PmWiki use the same
lockfile for every field, then it doesn't matter.  Just set

    $LockFile = '/path/to/common/.flock';

Make sure that PmWiki has write permission to whatever directory
contains the .flock file (/path/to/common/ above).

Pm




More information about the pmwiki-users mailing list