[pmwiki-users] Re: Using AllRecentChanges as a shared page between fields
Patrick R. Michaud
pmichaud at pobox.com
Sat Jul 23 20:58:19 CDT 2005
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. If we go to
the level of locking individual pages, we have to carefully sequence
things to avoid deadlocks (and in doing so we assume that we know
everything that needs to be locked).
I find it easier to just lock the whole update transaction.
> * 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,
> * 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. (Note that it doesn't have to be file-based, $WikiDir
could refer to something like a MySQL backend or a .dbm file.)
$WorkDir is string identifying a directory that PmWiki can use to
read and write temporary files. PmWiki needs this for a variety of
things, such as building merged edits, caching mailposts entries,
keeping track of the last modification time of the site, other types
of cache, etc.
To simplify things for the administrator PmWiki just happens to use
the same directory ("wiki.d") for both the PageStore and the work
directory, but it's not required.
More information about the pmwiki-users