當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。