final class LockManager implements LockManagerInterface (View source)

Methods

mixed
lock(string $file, callable $callback)
mixed

Details

__construct

__construct(DirectoryManagerInterface $directoryManager)

No description

Parameters

DirectoryManagerInterface $directoryManager

lock

mixed lock(string $file, callable $callback)

No description

Parameters

string $file
callable $callback

Return Value

mixed

Executes the given callback while holding an exclusive file lock.

The lock file directory is created automatically if it does not exist. The lock is released after the callback finishes, including when the callback throws an exception.