本文整理汇总了PHP中CacheManager::getPool方法的典型用法代码示例。如果您正苦于以下问题:PHP CacheManager::getPool方法的具体用法?PHP CacheManager::getPool怎么用?PHP CacheManager::getPool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CacheManager
的用法示例。
在下文中一共展示了CacheManager::getPool方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: drop
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();
}
}
}
}
示例2: setUp
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);
}
示例3: testGetPool
public function testGetPool()
{
$pool = CacheManager::getPool('test.simple');
$this->assertInstanceOf('\\Hoard\\PoolInterface', $pool);
}