/** * Invalidate the query cache * * @return void */ protected function invalidateQueryCache() { if ($this->queryCache) { $this->queryCache->clear(); $this->logger->log("Query cache invalidated", \Elgg\Logger::INFO); } }
/** * Invalidate the query cache * * @return void */ protected function invalidateQueryCache() { if ($this->query_cache) { $this->query_cache->clear(); if ($this->logger) { $this->logger->info("Query cache invalidated"); } } }
public function testLeastUsedItemGetsDropped() { $pool = new LRUCache(2); $pool->set('foo1', 10); $pool->set('foo2', 25); $this->assertEquals(25, $pool->get('foo2')); $pool->set('foo2', 20); $this->assertEquals(20, $pool->get('foo2')); $this->assertEquals(10, $pool->get('foo1')); // foo2 was least recently read $pool->set('foo3', 30); $this->assertEquals(null, $pool->get('foo2')); $this->assertFalse(isset($pool['foo2'])); $this->assertEquals(10, $pool->get('foo1')); $this->assertEquals(30, $pool->get('foo3')); $this->assertEquals(2, $pool->size()); }