本文整理匯總了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);
}