BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
FSLockManager Class Reference
Inheritance diagram for FSLockManager:
Collaboration diagram for FSLockManager:

Public Member Functions

 __construct (array $config)
 
 __destruct ()
 
- Public Member Functions inherited from LockManager
 __construct (array $config)
 
 lock (array $paths, $type=self::LOCK_EX, $timeout=0)
 
 lockByType (array $pathsByType, $timeout=0)
 
 unlock (array $paths, $type=self::LOCK_EX)
 
 unlockByType (array $pathsByType)
 

Protected Member Functions

 doLock (array $paths, $type)
 
 doUnlock (array $paths, $type)
 
 doSingleLock ($path, $type)
 
 doSingleUnlock ($path, $type)
 
 getLockPath ($path)
 
- Protected Member Functions inherited from LockManager
 sha1Base36Absolute ($path)
 
 sha1Base16Absolute ($path)
 
 normalizePathsByType (array $pathsByType)
 
 doLockByType (array $pathsByType)
 
 doLock (array $paths, $type)
 
 doUnlockByType (array $pathsByType)
 
 doUnlock (array $paths, $type)
 

Protected Attributes

 $lockTypeMap
 
 $lockDir
 
 $handles = []
 
- Protected Attributes inherited from LockManager
 $lockTypeMap
 
 $locksHeld = []
 
 $domain
 
 $lockTTL
 

Additional Inherited Members

- Public Attributes inherited from LockManager
const LOCK_SH = 1
 
const LOCK_UW = 2
 
const LOCK_EX = 3
 

Detailed Description

Simple version of LockManager based on using FS lock files. All locks are non-blocking, which avoids deadlocks.

This should work fine for small sites running off one server. Do not use this with 'lockDirectory' set to an NFS mount unless the NFS client is at least version 2.6.12. Otherwise, the BSD flock() locks will be ignored; see http://nfs.sourceforge.net/#section_d.

Since
1.19

Constructor & Destructor Documentation

FSLockManager::__construct ( array  $config)

Construct a new instance from configuration.

Parameters
array$configIncludes:
  • lockDirectory : Directory containing the lock files
FSLockManager::__destruct ( )

Make sure remaining locks get cleared for sanity

Member Function Documentation

FSLockManager::doLock ( array  $paths,
  $type 
)
protected
See Also
LockManager::doLock()
Parameters
array$paths
int$type
Returns
Status
FSLockManager::doSingleLock (   $path,
  $type 
)
protected

Lock a single resource key

Parameters
string$path
int$type
Returns
Status
FSLockManager::doSingleUnlock (   $path,
  $type 
)
protected

Unlock a single resource key

Parameters
string$path
int$type
Returns
Status
FSLockManager::doUnlock ( array  $paths,
  $type 
)
protected
See Also
LockManager::doUnlock()
Parameters
array$paths
int$type
Returns
Status
FSLockManager::getLockPath (   $path)
protected

Get the path to the lock file for a key

Parameters
string$path
Returns
string

Member Data Documentation

FSLockManager::$lockTypeMap
protected
Initial value:
= [
self::LOCK_SH => self::LOCK_SH

The documentation for this class was generated from the following file: