[pmwiki-users] Re: Re: Using AllRecentChanges as a shared page between fields

chr at home.se chr at home.se
Sun Jul 24 05:46:05 CDT 2005


On Sat, 23 Jul 2005, Patrick R. Michaud wrote:

> On Sun, Jul 24, 2005 at 01:44:09AM +0200, chr at home.se wrote:
> > PS. Two comments from glancing at the code. 
> > * Would it make sense to let Lock() take a second (optional) argument
> >   that is a pagename, and use that to create a unique lock file?
> 
> Probably not.  PmWiki isn't really doing locks to protect an individual
> page -- it looks at updates as being "transactions" that could have
> dependencies on and/or change the values of many pages.
[..]

Ok, I see.

> > * The variable $WorkDir doesn't seem very useful...  it's only used in
> >   Lock(), and to give a default argument to PageStore(). What I really 
> >   wonder is why $WorkDir isn't used in this assignment
> > 	$WikiDir = new PageStore('wiki.d/$FullName');
> 
> $WorkDir is also used in scripts/mailposts.php, scripts/stdconfig.php,
> and scripts/simuledit.php.  
> 
> > * What is the difference (if any) between $WorkDir and $WikiDir?
> >   ($WorkDir isn't documented AFAICT at pmwiki.org - hint, hint:-)
> 
> The biggest difference is that $WikiDir is a PageStore while
> $WorkDir is a directory.  $WikiDir is an object used to store and 
> retrieve pages.

Duh... I guess this goes to show that the names $WikiDir v.s. $WorkDir are 
a bit confusing... (to similar).

Btw, we have $FarmD, where I thought the 'D' stood for directory...  
shouldn't either $FarmD become $FarmDir, or $WorkDir become $WorkD then?
(I'm not saying this should be changed since it might break old stuff, but
I'm curious about the logic in the names)

> $WorkDir is string identifying a directory that PmWiki can use to 
> read and write temporary files.

I see.. if it'd been called something like $TmpDir this would be a bit
more clear. This temporary use of wiki.d/ is new to me, but does explain
the files I sometimes find in that directory - I guess they're not always
deleted as they should be. The next time I find "left-overs" there I'll
try to remember to let you know about them. In addition, I think that
using wiki.d/ in this way isn't "clean", and speaks for changing the
directory structure into something like

	data.d/
	  |-- tmp/	- temporary files and locking flag
	  |-- wiki.d/	- only stored wiki pages
	  ...

Actually, with the structure above the directory containing pages could be 
given a more descriptive name such as 'pages', i.e.

	data.d/
	  |-- tmp/
	  |-- pages/
	  ..


Anyway, I put some notes on $WikiDir and $WorkDir here:

	http://www.pmwiki.org/wiki/PmWiki/OtherVariables

/Christian

-- 
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr







More information about the pmwiki-users mailing list