Stud.IP  2.4 Revision 48548
 All Data Structures Namespaces Files Functions Variables Groups Pages
FileLock Class Reference
Collaboration diagram for FileLock:
Collaboration graph

Public Member Functions

 __construct ($id)
 lock ($data=array())
 isLocked (&$lock_data=null)
 release ()

Static Public Member Functions

static setDirectory ($directory)

Protected Attributes

 $filename

Static Protected Attributes

static $directory = ''

Constructor & Destructor Documentation

__construct (   $id)

Constructs a new lock object with the provided id.

Parameters
String$idIdentifier of the lock

Member Function Documentation

isLocked ( $lock_data = null)

Tests whether the lock is in use. Returns lock information in $lock_data.

Parameters
mixed$lock_dataInformation stored in lock
Returns
bool Indicates whether the lock is active or not
lock (   $data = array())

Establish or renew the current lock. Provided lock information will be stored with the lock.

Parameters
Array$dataAdditional information to bestore with the lock
release ( )

Releases a previously obtained lock

static setDirectory (   $directory)
static

Sets a new base path for the locks.

Parameters
String$directory
Exceptions
RuntimeExceptionif provided directory is either not existant or is not a directory or is not writable.

Field Documentation

$directory = ''
staticprotected
$filename
protected

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