PHP Class NinjaMutex\Lock\FlockLock

Author: Kamil Dziedzic ([email protected])
Inheritance: extends NinjaMutex\Lock\LockAbstract
Datei anzeigen Open project: arvenil/ninja-mutex Class Usage Examples

Protected Properties

Property Type Description
$dirname
$files

Public Methods

Method Description
__clone ( )
__construct ( string $dirname )
__destruct ( ) Try to release any obtained locks when object is destroyed
isLocked ( string $name ) : boolean Check if lock is locked
releaseLock ( string $name ) : boolean Release lock

Protected Methods

Method Description
getFilePath ( string $name ) : string
getLock ( string $name, boolean $blocking ) : boolean
setupFileHandle ( string $name ) : boolean

Method Details

__clone() public method

public __clone ( )

__construct() public method

public __construct ( string $dirname )
$dirname string

__destruct() public method

This is a safe guard for cases when your php script dies unexpectedly. It's not guaranteed it will work either. You should not depend on __destruct() to release your locks, instead release them with $released = $this->releaseLock()A and check $released if lock was properly released
public __destruct ( )

getFilePath() protected method

protected getFilePath ( string $name ) : string
$name string
return string

getLock() protected method

protected getLock ( string $name, boolean $blocking ) : boolean
$name string
$blocking boolean
return boolean

isLocked() public method

Check if lock is locked
public isLocked ( string $name ) : boolean
$name string name of lock
return boolean

releaseLock() public method

Release lock
public releaseLock ( string $name ) : boolean
$name string name of lock
return boolean

setupFileHandle() protected method

protected setupFileHandle ( string $name ) : boolean
$name string
return boolean

Property Details

$dirname protected_oe property

protected $dirname

$files protected_oe property

protected $files