FileLockInterface
interface FileLockInterface implements LoggerAwareInterface
Interface that a file lock.
Constants
LOCK_SHARED |
Option for shared lock. |
LOCK_EXCLUSIVE |
Option for exclusive lock. |
LOCK_NON_BLOCKING |
Option for non-blocking lock acquisition. |
LOCK_BLOCKING |
Option for blocking lock acquisition. |
Methods
Construct file lock with file name and optional options bitmask and logger instance.
Assign the options bitmask to configure locking behavior.
Returns true if lock has been acquired.
Returns true if lock is shared.
Returns true if lock is exclusive.
Returns if lock is blocking.
Returns true if lock is non blocking.
Returns true if file handle is held.
Returns the file handle.
Try to acquire a file lock.
Try to release a file lock.
Details
at line line 49
__construct(
string $file,
null|int $options = null,
LoggerInterface $logger = null)
Construct file lock with file name and optional options bitmask and logger instance.
at line line 56
setOptions(
int $options)
Assign the options bitmask to configure locking behavior.
at line line 63
bool
isAcquired()
Returns true if lock has been acquired.
at line line 70
bool
isShared()
Returns true if lock is shared.
at line line 77
bool
isExclusive()
Returns true if lock is exclusive.
at line line 84
bool
isBlocking()
Returns if lock is blocking.
at line line 91
bool
isNonBlocking()
Returns true if lock is non blocking.
at line line 98
bool
hasResource()
Returns true if file handle is held.
at line line 105
resource
getResource()
Returns the file handle.
at line line 112
bool
acquire()
Try to acquire a file lock.
at line line 119
bool
release()
Try to release a file lock.