Stud.IP  5.4
FileLock Class Reference

Public Member Functions

 __construct ($id)
 
 tryLock (&$data=[])
 
 release ()
 

Protected Attributes

 $file
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $id)

Constructs a new lock object with the provided id.

Parameters
String$idIdentifier of the lock

Member Function Documentation

◆ release()

release ( )

Releases a previously obtained lock

Returns
boolean true on success or false on failure

◆ tryLock()

tryLock ( $data = [])

Try to aquire a file lock. The provided lock information will be stored with the lock. If the lock cannot be aquired, the lock information in $data is updated from the lock file.

Parameters
array$dataadditional data to be stored with the lock
Returns
boolean true on success or false on failure

Field Documentation

◆ $file

$file
protected

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