/** * Locks a uri * * All the locking information is supplied in the lockInfo object. The object has a suggested timeout, but this can be safely ignored * It is important that if the existing timeout is ignored, the property is overwritten, as this needs to be sent back to the client * * @param string $uri * @param LockInfo $lockInfo * @return bool */ function lockNode($uri, LockInfo $lockInfo) { if (!$this->server->emit('beforeLock', [$uri, $lockInfo])) { return; } return $this->locksBackend->lock($uri, $lockInfo); }
/** * Locks a uri * * All the locking information is supplied in the lockInfo object. The object has a suggested timeout, but this can be safely ignored * It is important that if the existing timeout is ignored, the property is overwritten, as this needs to be sent back to the client * * @param string $uri * @param LockInfo $lockInfo * @return bool */ public function lockNode($uri, LockInfo $lockInfo) { if (!$this->server->broadcastEvent('beforeLock', array($uri, $lockInfo))) { return; } if ($this->locksBackend) { return $this->locksBackend->lock($uri, $lockInfo); } throw new DAV\Exception\MethodNotAllowed('Locking support is not enabled for this resource. No Locking backend was found so if you didn\'t expect this error, please check your configuration.'); }