Documentation

FileLock
in package

Table of Contents

Properties

$lockFile  : string

Methods

__construct()  : mixed
acquire()  : bool
Attempts to acquire a file lock. Returns true if successful, false if lock already exists.
isLocked()  : bool
Checks if the lock is currently active.
release()  : void
Releases the file lock by deleting the lock file.

Properties

Methods

__construct()

public __construct(string $lockName) : mixed
Parameters
$lockName : string

acquire()

Attempts to acquire a file lock. Returns true if successful, false if lock already exists.

public acquire() : bool
Return values
bool

True if lock acquired, false if already locked.

isLocked()

Checks if the lock is currently active.

public isLocked() : bool
Return values
bool

True if locked, false otherwise.

release()

Releases the file lock by deleting the lock file.

public release() : void

        
On this page

Search results