public function drop(array $args) { foreach ($args as $arg) { if (strpos($arg, ':') === false) { $pool = CacheManager::getPool($arg); $pool->clear(); } else { list($poolName, $keys) = explode(':', $arg); $pool = CacheManager::getPool($poolName); $keys = preg_split('/\\s*,\\s*/', $keys); foreach ($keys as $key) { $item = $pool->getItem($key); $item->delete(); } } } }
public function setUp() { $this->runner = new ScriptRunner(''); try { // create our running application cache $this->pool = CacheManager::getPool('test.memcached'); $this->pool->clear(); } catch (\Exception $e) { if ($e->getMessage() == 'Memcached extension is not installed.') { $this->markTestSkipped(); } throw $e; } $this->add('mykey1', 'some data'); $this->add('mykey2', 'some other data'); $this->add('mykey3', 123); }
public function testGetPool() { $pool = CacheManager::getPool('test.simple'); $this->assertInstanceOf('\\Hoard\\PoolInterface', $pool); }