当前位置: 首页>>代码示例>>PHP>>正文


PHP Cache::deleteMany方法代码示例

本文整理汇总了PHP中Cake\Cache\Cache::deleteMany方法的典型用法代码示例。如果您正苦于以下问题:PHP Cache::deleteMany方法的具体用法?PHP Cache::deleteMany怎么用?PHP Cache::deleteMany使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cake\Cache\Cache的用法示例。


在下文中一共展示了Cache::deleteMany方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testDeleteMany

 /**
  * testDeleteMany method
  *
  * @return void
  */
 public function testDeleteMany()
 {
     $this->_configCache();
     $data = array('App.falseTest' => false, 'App.trueTest' => true, 'App.nullTest' => null, 'App.zeroTest' => 0, 'App.zeroTest2' => '0');
     Cache::writeMany(array_merge($data, array('App.keepTest' => 'keepMe')), 'tests');
     Cache::deleteMany(array_keys($data), 'tests');
     $read = Cache::readMany(array_merge(array_keys($data), array('App.keepTest')), 'tests');
     $this->assertSame($read['App.falseTest'], false);
     $this->assertSame($read['App.trueTest'], false);
     $this->assertSame($read['App.nullTest'], false);
     $this->assertSame($read['App.zeroTest'], false);
     $this->assertSame($read['App.zeroTest2'], false);
     $this->assertSame($read['App.keepTest'], 'keepMe');
 }
开发者ID:maitrepylos,项目名称:nazeweb,代码行数:19,代码来源:CacheTest.php

示例2: testDeleteMany

 /**
  * testDeleteMany method
  *
  * @return void
  */
 public function testDeleteMany()
 {
     $this->skipIf(defined('HHVM_VERSION'), 'HHVM does not implement deleteMulti');
     $this->_configCache();
     $data = ['App.falseTest' => false, 'App.trueTest' => true, 'App.nullTest' => null, 'App.zeroTest' => 0, 'App.zeroTest2' => '0'];
     foreach ($data as $key => $value) {
         Cache::write($key, $value, 'memcached');
     }
     Cache::write('App.keepTest', 'keepMe', 'memcached');
     Cache::deleteMany(array_merge(array_keys($data), ['App.doesNotExist']), 'memcached');
     $this->assertSame(Cache::read('App.falseTest', 'memcached'), false);
     $this->assertSame(Cache::read('App.trueTest', 'memcached'), false);
     $this->assertSame(Cache::read('App.nullTest', 'memcached'), false);
     $this->assertSame(Cache::read('App.zeroTest', 'memcached'), false);
     $this->assertSame(Cache::read('App.zeroTest2', 'memcached'), false);
     $this->assertSame(Cache::read('App.keepTest', 'memcached'), 'keepMe');
 }
开发者ID:KarimaLadhani,项目名称:cakephp,代码行数:22,代码来源:MemcachedEngineTest.php

示例3: testDeleteMany

 /**
  * testDeleteMany method
  *
  * @return void
  */
 public function testDeleteMany()
 {
     $this->_configCache();
     $data = array('App.falseTest' => false, 'App.trueTest' => true, 'App.nullTest' => null, 'App.zeroTest' => 0, 'App.zeroTest2' => '0');
     foreach ($data as $key => $value) {
         Cache::write($key, $value, 'memcached');
     }
     Cache::write('App.keepTest', 'keepMe', 'memcached');
     Cache::deleteMany(array_merge(array_keys($data), ['App.doesNotExist']), 'memcached');
     $this->assertSame(Cache::read('App.falseTest', 'memcached'), false);
     $this->assertSame(Cache::read('App.trueTest', 'memcached'), false);
     $this->assertSame(Cache::read('App.nullTest', 'memcached'), false);
     $this->assertSame(Cache::read('App.zeroTest', 'memcached'), false);
     $this->assertSame(Cache::read('App.zeroTest2', 'memcached'), false);
     $this->assertSame(Cache::read('App.keepTest', 'memcached'), 'keepMe');
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:21,代码来源:MemcachedEngineTest.php


注:本文中的Cake\Cache\Cache::deleteMany方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。