LockHandler

LockHandler

class LockHandler

LockHandler class provides a simple abstraction to lock anything by means of a file lock.

A locked file is created based on the lock name when calling lock(). Other lock handlers will not be able to lock the same name until it is released (explicitly by calling release() or implicitly when the instance holding the lock is destroyed).

Methods

__construct(string $name, string|null $lockPath = null)
bool lock(bool $blocking = false)

Lock the resource.

release()

Release the resource.

Details

__construct(string $nam