Example #1
0
 /**
  * Purges locks under $path.
  *
  * Checks all active locks on any resource under $path. Purges every lock
  * that has not been accessed for its $timeout value.
  * 
  * @param string $path 
  *
  * @throws ezcWebdavLockAdministrationException
  *         if searching for locks or purging an outdated lock failed.
  */
 public function purgeLocks($path)
 {
     $this->locksToPurge = array();
     $this->lockProperties = array();
     $propFindReq = new ezcWebdavPropFindRequest($path);
     $propFindReq->prop = new ezcWebdavBasicPropertyStorage();
     $propFindReq->prop->attach(new ezcWebdavLockDiscoveryProperty());
     $propFindReq->setHeader('Depth', ezcWebdavRequest::DEPTH_INFINITY);
     $propFindReq->validateHeaders();
     $propFindMultistatusRes = $this->backend->propFind($propFindReq);
     if (!$propFindMultistatusRes instanceof ezcWebdavMultistatusResponse) {
         throw new ezcWebdavLockAdministrationException('Finding locks failed.', $propFindMultistatusRes);
     }
     $this->collectPurgeProperties($propFindMultistatusRes);
     if ($this->locksToPurge !== array()) {
         $this->performPurge();
     }
 }