SourceForge logo
SourceForge logo
Menu

phpwiki-checkins

From: Reini U. <ru...@us...> - 2004年05月27日 17:49:16
Update of /cvsroot/phpwiki/phpwiki/lib/pear
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15781/pear
Modified Files:
	File_Passwd.php 
Log Message:
renamed DB_Session to DbSession (in CVS also)
added WikiDB->getParam and WikiDB->getAuthParam method to get rid of globals
remove leading slash in error message
added force_unlock parameter to File_Passwd (no return on stale locks)
fixed adodb session AffectedRows
added FileFinder helpers to unify local filenames and DATA_PATH names
editpage.php: new edit toolbar javascript on ENABLE_EDIT_TOOLBAR
Index: File_Passwd.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/pear/File_Passwd.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -2 -b -p -d -r1.6 -r1.7
--- File_Passwd.php	26 Apr 2004 20:44:36 -0000	1.6
+++ File_Passwd.php	27 May 2004 17:49:06 -0000	1.7
@@ -89,5 +89,16 @@ class File_Passwd {
 }
 
- if($lock) {
+ if ($lock) {
+ //check if already locked, on some error or race condition or other user.
+ //FIXME: implement timeout as with dba
+ if (file_exists($this->lockfile)) {
+ 	if (isset($GLOBALS['HTTP_GET_VARS']['force_unlock'])) {
+ 	 $this->fplock = fopen($this->lockfile, 'w');
+ 	 flock($this->fplock, LOCK_UN);
+ 	 fclose($this->fplock);
+ 	} else {
+ trigger_error('File_Passwd lock conflict: Try &force_unlock=1',E_USER_NOTICE);
+ 	}
+ }
 $this->fplock = fopen($this->lockfile, 'w');
 flock($this->fplock, LOCK_EX);
@@ -96,5 +107,5 @@ class File_Passwd {
 
 $fp = fopen($file,'r') ;
- if( !$fp) {
+ if( !$fp ) {
 return new PEAR_Error( "Couldn't open '$file'!", 1, PEAR_ERROR_RETURN) ;
 }
@@ -112,5 +123,5 @@ class File_Passwd {
 }
 fclose($fp);
- } // end func File_Passwd()
+ }
 
 /**
@@ -221,5 +232,5 @@ class File_Passwd {
 */
 function close() {
- if($this->locked) {
+ if ($this->locked) {
 foreach($this->users as $user => $pass) {
 if (isset($this->cvs[$user])) {
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /