PHP Class Jenner\SimpleFork\Lock\FileLock

Inheritance: implements Jenner\SimpleFork\Lock\LockInterface
Datei anzeigen Open project: huyanping/simple-fork-php Class Usage Examples

Protected Properties

Property Type Description
$file lock file
$fp resource
$locked boolean

Public Methods

Method Description
__destory ( )
acquire ( boolean $blocking = true ) : mixed get a lock
create ( string $file ) : FileLock create a file lock instance if the file is not exists, it will be created
isLocked ( ) : mixed is locked
release ( ) : mixed release lock

Private Methods

Method Description
__construct ( $file )

Method Details

__destory() public method

public __destory ( )

acquire() public method

get a lock
public acquire ( boolean $blocking = true ) : mixed
$blocking boolean
return mixed

create() public static method

create a file lock instance if the file is not exists, it will be created
public static create ( string $file ) : FileLock
$file string lock file
return FileLock

isLocked() public method

is locked
public isLocked ( ) : mixed
return mixed

release() public method

release lock
public release ( ) : mixed
return mixed

Property Details

$file protected_oe property

lock file
protected $file

$fp protected_oe property

protected resource $fp
return resource

$locked protected_oe property

protected bool $locked
return boolean