<?php public function getSharedLock($block = false)
{
if (! flock($this->handle, LOCK_SH | ($block ? 0 : LOCK_NB))) {
throw new LockTimeoutException("Unable to acquire file lock at path [{$this->path}].");
}
<?php public function getExclusiveLock($block = false)
{
if (! flock($this->handle, LOCK_EX | ($block ? 0 : LOCK_NB))) {
throw new LockTimeoutException("Unable to acquire file lock at path [{$this->path}].");
}