示例#1
0
 /**
  * @covers HashBagOStuff::delete
  */
 public function testDelete()
 {
     $cache = new HashBagOStuff();
     for ($i = 0; $i < 10; $i++) {
         $cache->set("key{$i}", 1);
         $this->assertEquals(1, $cache->get("key{$i}"));
         $cache->delete("key{$i}");
         $this->assertEquals(false, $cache->get("key{$i}"));
     }
 }
示例#2
0
 private function uncacheUser(User $user)
 {
     $this->stats->increment('WatchedItemStore.uncacheUser');
     foreach ($this->cacheIndex as $ns => $dbKeyArray) {
         foreach ($dbKeyArray as $dbKey => $userArray) {
             if (isset($userArray[$user->getId()])) {
                 $this->stats->increment('WatchedItemStore.uncacheUser.items');
                 $this->cache->delete($userArray[$user->getId()]);
             }
         }
     }
 }
示例#3
0
 /**
  * @param Title $title
  */
 public function clearLink($title)
 {
     $dbkey = $title->getPrefixedDBkey();
     $this->mBadLinks->delete($dbkey);
     $this->mGoodLinks->delete($dbkey);
 }
示例#4
0
 /**
  * @param LinkTarget $target
  */
 public function clearLink(LinkTarget $target)
 {
     $dbkey = $this->titleFormatter->getPrefixedDBkey($target);
     $this->mBadLinks->delete($dbkey);
     $this->mGoodLinks->delete($dbkey);
 }