final class LockManager implements LockManagerInterface (View source)

Executes callbacks under an exclusive local file lock and preserves callback failures as filesystem causes.

Methods

Retains the directory collaborator used to prepare lock-file parents.

mixed
lock(string $file, callable $callback)

Executes the callback under an exclusive lock and keeps callback failures primary during cleanup.

mixed

Details

__construct

__construct(DirectoryManagerInterface $directoryManager)

Retains the directory collaborator used to prepare lock-file parents.

Parameters

DirectoryManagerInterface $directoryManager

lock

mixed lock(string $file, callable $callback)

Executes the callback under an exclusive lock and keeps callback failures primary during cleanup.

Parameters

string $file
callable $callback

Return Value

mixed

Exceptions

FilesystemException