STREAMWRAPPER.STREAM_LOCK(3) 1 STREAMWRAPPER.STREAM_LOCK(3)
streamWrapper::stream_lock - Advisory file locking
SYNOPSIS
public bool streamWrapper::stream_lock (int $operation)
DESCRIPTION
This method is called in response to flock(3), when file_put_contents(3) (when $flags contains LOCK_EX), stream_set_blocking(3) and when
closing the stream ( LOCK_UN).
PARAMETERS
o $operation
-$operation is one of the following:
o LOCK_SH to acquire a shared lock (reader).
o LOCK_EX to acquire an exclusive lock (writer).
o LOCK_UN to release a lock (shared or exclusive).
o LOCK_NB if you don't want flock(3) to block while locking. (not supported on Windows)
RETURN VALUES
Returns TRUE on success or FALSE on failure.
ERRORS
/EXCEPTIONS
Emits E_WARNING if call to this method fails (i.e. not implemented).
SEE ALSO
stream_set_blocking(3), flock(3).
PHP Documentation Group STREAMWRAPPER.STREAM_LOCK(3)