From c9b4bd1e30a047b11d0beaa4458204126e0c1b92 Mon Sep 17 00:00:00 2001 From: Ben Coburn Date: Wed, 5 Jul 2006 05:31:35 +0200 Subject: 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 --- inc/common.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'inc/common.php') diff --git a/inc/common.php b/inc/common.php index e47b4e7a3..b1246ba7f 100644 --- a/inc/common.php +++ b/inc/common.php @@ -523,7 +523,7 @@ function clientIP($single=false){ */ function checklock($id){ global $conf; - $lock = wikiFN($id).'.lock'; + $lock = wikiLockFN($id); //no lockfile if(!@file_exists($lock)) return false; @@ -549,7 +549,7 @@ function checklock($id){ * @author Andreas Gohr */ function lock($id){ - $lock = wikiFN($id).'.lock'; + $lock = wikiLockFN($id); if($_SERVER['REMOTE_USER']){ io_saveFile($lock,$_SERVER['REMOTE_USER']); }else{ @@ -564,7 +564,7 @@ function lock($id){ * @return bool true if a lock was removed */ function unlock($id){ - $lock = wikiFN($id).'.lock'; + $lock = wikiLockFN($id); if(@file_exists($lock)){ $ip = io_readFile($lock); if( ($ip == clientIP()) || ($ip == $_SERVER['REMOTE_USER']) ){ -- cgit v1.2.3