コード例 #1
0
 public function testExpiry()
 {
     $blobStore = new BlobStore('Foo', $this->cache);
     $blobStore->setExpiryInSeconds(4);
     $container = $blobStore->read('bar');
     $container->set('one', 1001);
     $blobStore->save($container);
     $container = $blobStore->read('foo');
     $container->set('one', 42);
     $blobStore->save($container);
     $this->assertTrue($blobStore->exists('bar'));
     $this->assertTrue($blobStore->exists('foo'));
     sleep(5);
     $this->assertFalse($blobStore->exists('bar'));
     $this->assertFalse($blobStore->exists('foo'));
 }
コード例 #2
0
 /**
  * @since 2.5
  *
  * @param DIWikiPage|array $list
  */
 public function resetCacheBy($item)
 {
     if (!is_array($item)) {
         $item = array($item);
     }
     $recordStats = false;
     foreach ($item as $id) {
         $id = $this->getHashFrom($id);
         if ($this->blobStore->exists($id)) {
             $recordStats = true;
             $this->transientStatsdCollector->incr('deletes');
             $this->blobStore->delete($id);
         }
     }
     if ($recordStats) {
         $this->recordStats();
     }
 }