コード例 #1
0
ファイル: LockDiscovery.php プロジェクト: samizdam/WebDAV
 /**
  * Add an lock to the list of active locks
  *
  * @param Lock $lock The lock to add
  */
 private function add(Lock $lock)
 {
     $index = count($this->locks);
     if ($lock->getToken()) {
         $this->tokens[$lock->getToken()] = $index;
     }
     $type = $lock->getType();
     $scope = $lock->getScope();
     $hashKey = $this->getHashKey($type, $scope);
     if (!isset($this->index[$type])) {
         $this->index[$type] = array();
     }
     if (!isset($this->index[$hashKey])) {
         $this->index[$hashKey] = array();
     }
     $this->index[$type][] = $index;
     $this->index[$hashKey][] = $index;
     $this->locks[] = $lock;
 }
コード例 #2
0
ファイル: LockTest.php プロジェクト: samizdam/WebDAV
 public function testDefaultScope()
 {
     $this->assertEquals('exclusive', $this->lock->getScope());
     $this->assertTrue($this->lock->isExclusive());
 }