diff options
author | Ben Coburn <btcoburn@silicodon.net> | 2006-07-05 05:31:35 +0200 |
---|---|---|
committer | Ben Coburn <btcoburn@silicodon.net> | 2006-07-05 05:31:35 +0200 |
commit | c9b4bd1e30a047b11d0beaa4458204126e0c1b92 (patch) | |
tree | fcc68cf213146532363ca534c6e4a65e458a6b21 /inc/pageutils.php | |
parent | 306ca8aa54954ea2623d9e4927a2c07b9efdfea3 (diff) | |
download | rpg-c9b4bd1e30a047b11d0beaa4458204126e0c1b92.tar.gz rpg-c9b4bd1e30a047b11d0beaa4458204126e0c1b92.tar.bz2 |
refactor wiki page edit locking
- Adds a new function in 'inc/pageutils.php', wikiLockFN($id)
- All page edit locks should now be created with the file name
generated by wikiLockFN($id).
- wikiLockFN
- Generates wiki page editing locks in the 'data/locks'
directory where they belong.
- This avoids polluting the 'data/pages' directory with lock files,
which were causing namespaces to be created before they logically
should exist.
darcs-hash:20060705033135-05dcb-8eac316587cd54c6ebd861fe7b15975d90b0e4dc.gz
Diffstat (limited to 'inc/pageutils.php')
-rw-r--r-- | inc/pageutils.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/inc/pageutils.php b/inc/pageutils.php index f9d182aac..c10c1c4e8 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -152,6 +152,17 @@ function wikiFN($id,$rev=''){ } /** + * Returns the full path to the file for locking the page while editing. + * + * @author Ben Coburn <btcoburn@silicodon.net> + */ +function wikiLockFN($id) { + global $conf; + return $conf['lockdir'].'/'.sha1(cleanID($id)).'.lock'; +} + + +/** * returns the full path to the meta file specified by ID and extension * * The filename is URL encoded to protect Unicode chars |