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


PHP Cache::drop方法代码示例

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


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

示例1: tearDown

 /**
  * Teardown
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     Cache::drop('orm_cache');
     $ds = ConnectionManager::get('test');
     $ds->cacheMetadata(false);
 }
开发者ID:maitrepylos,项目名称:nazeweb,代码行数:12,代码来源:OrmCacheShellTest.php

示例2: tearDown

 /**
  * tearDown
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     Cache::clear(false, 'session_test');
     Cache::drop('session_test');
     unset($this->storage);
 }
开发者ID:Slayug,项目名称:castor,代码行数:12,代码来源:CacheSessionTest.php

示例3: tearDown

 /**
  * Tear down data.
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     Plugin::unload($this->plugin);
     Cache::drop('permissions');
     Cache::drop('permission_roles');
     unset($this->Roles, $this->Users, $this->userData);
 }
开发者ID:UnionCMS,项目名称:Community,代码行数:13,代码来源:TestCase.php

示例4: tearDown

 /**
  * Tear down.
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     unset($this->_controller, $this->url, $this->data);
     Plugin::unload($this->plugin);
     Plugin::unload('Union/Extensions');
     Cache::drop('permissions');
     Cache::drop('permission_roles');
     Cache::drop('plugins');
 }
开发者ID:UnionCMS,项目名称:Community,代码行数:15,代码来源:IntegrationCase.php

示例5: beforeFilter

 /**
  * Called before the controller action. You can use this method to configure and customize components
  * or perform logic that needs to happen before each controller action.
  *
  * @param Event $event An Event instance
  * @return void
  * @link http://book.cakephp.org/3.0/en/controllers.html#request-life-cycle-callbacks
  */
 public function beforeFilter(Event $event)
 {
     parent::beforeFilter($event);
     // TODO: Change the autogenerated stub
     if ($this->request->data) {
         Cache::drop('settingsFrontend');
         Cache::drop('menuParents');
         Cache::drop('subMenu');
     }
 }
开发者ID:nguyennghiem1205,项目名称:japan-circle,代码行数:18,代码来源:AppController.php

示例6: __construct

 /**
  * CacheStorage constructor.
  * @param array $config initial configuration
  */
 public function __construct(array $config)
 {
     $this->config($config);
     $_config = $this->config();
     $_configName = $_config['cacheConfig'];
     unset($_config['cacheConfig']);
     if (Cache::config($_configName)) {
         Cache::drop($_configName);
     }
     Cache::config($_configName, $_config);
 }
开发者ID:xavier83ar,项目名称:cakephp-cookie-auth,代码行数:15,代码来源:CacheStorage.php

示例7: initialize

 /**
  * Initialize - install cache spies.
  *
  * @return void
  */
 public function initialize()
 {
     foreach (Cache::configured() as $name) {
         $config = Cache::config($name);
         if ($config['className'] instanceof DebugEngine) {
             $instance = $config['className'];
         } else {
             Cache::drop($name);
             $instance = new DebugEngine($config);
             Cache::config($name, $instance);
         }
         $this->_instances[$name] = $instance;
     }
 }
开发者ID:JesseDarellMoore,项目名称:CS499,代码行数:19,代码来源:CachePanel.php

示例8: testStoreAndRestoreWithData

 /**
  * test that store and restore only store/restore the provided data.
  *
  * @return void
  */
 public function testStoreAndRestoreWithData()
 {
     Cache::enable();
     Cache::config('configure', ['className' => 'File', 'path' => TMP . 'tests']);
     Configure::write('testing', 'value');
     Configure::store('store_test', 'configure', ['store_test' => 'one']);
     Configure::delete('testing');
     $this->assertNull(Configure::read('store_test'), 'Calling store with data shouldn\'t modify runtime.');
     Configure::restore('store_test', 'configure');
     $this->assertEquals('one', Configure::read('store_test'));
     $this->assertNull(Configure::read('testing'), 'Values that were not stored are not restored.');
     Cache::delete('store_test', 'configure');
     Cache::drop('configure');
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:19,代码来源:ConfigureTest.php

示例9: testClearingWithRepeatWrites

 /**
  * Test that clearing with repeat writes works properly
  *
  * @return void
  */
 public function testClearingWithRepeatWrites()
 {
     Cache::config('repeat', ['engine' => 'File', 'groups' => ['users']]);
     $this->assertTrue(Cache::write('user', 'rchavik', 'repeat'));
     $this->assertEquals('rchavik', Cache::read('user', 'repeat'));
     Cache::delete('user', 'repeat');
     $this->assertEquals(false, Cache::read('user', 'repeat'));
     $this->assertTrue(Cache::write('user', 'ADmad', 'repeat'));
     $this->assertEquals('ADmad', Cache::read('user', 'repeat'));
     Cache::clearGroup('users', 'repeat');
     $this->assertEquals(false, Cache::read('user', 'repeat'));
     $this->assertTrue(Cache::write('user', 'markstory', 'repeat'));
     $this->assertEquals('markstory', Cache::read('user', 'repeat'));
     Cache::drop('repeat');
 }
开发者ID:KarimaLadhani,项目名称:cakephp,代码行数:20,代码来源:FileEngineTest.php

示例10: testElementCache

 /**
  * Test elementCache method
  *
  * @return void
  */
 public function testElementCache()
 {
     Cache::drop('test_view');
     Cache::config('test_view', ['engine' => 'File', 'duration' => '+1 day', 'path' => CACHE . 'views/', 'prefix' => '']);
     Cache::clear(false, 'test_view');
     $View = $this->PostsController->createView();
     $View->elementCache = 'test_view';
     $result = $View->element('test_element', [], ['cache' => true]);
     $expected = 'this is the test element';
     $this->assertEquals($expected, $result);
     $result = Cache::read('element__test_element_cache_callbacks', 'test_view');
     $this->assertEquals($expected, $result);
     $result = $View->element('test_element', ['param' => 'one', 'foo' => 'two'], ['cache' => true]);
     $this->assertEquals($expected, $result);
     $result = Cache::read('element__test_element_cache_callbacks_param_foo', 'test_view');
     $this->assertEquals($expected, $result);
     $View->element('test_element', ['param' => 'one', 'foo' => 'two'], ['cache' => ['key' => 'custom_key']]);
     $result = Cache::read('element_custom_key', 'test_view');
     $this->assertEquals($expected, $result);
     $View->elementCache = 'default';
     $View->element('test_element', ['param' => 'one', 'foo' => 'two'], ['cache' => ['config' => 'test_view']]);
     $result = Cache::read('element__test_element_cache_callbacks_param_foo', 'test_view');
     $this->assertEquals($expected, $result);
     Cache::clear(true, 'test_view');
     Cache::drop('test_view');
 }
开发者ID:neilan35,项目名称:betterwindow1,代码行数:31,代码来源:ViewTest.php

示例11: tearDown

 /**
  * tearDown method
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     unset($this->Acl);
     Cache::clear(false, 'tests');
     Cache::drop('tests');
 }
开发者ID:edukondaluetg,项目名称:acl,代码行数:12,代码来源:CacheDbAclTest.php

示例12: testMultiDatabaseOperations

 /**
  * testMultiDatabaseOperations method
  *
  * @return void
  */
 public function testMultiDatabaseOperations()
 {
     Cache::config('redisdb0', array('engine' => 'Redis', 'prefix' => 'cake2_', 'duration' => 3600, 'persistent' => false));
     Cache::config('redisdb1', array('engine' => 'Redis', 'database' => 1, 'prefix' => 'cake2_', 'duration' => 3600, 'persistent' => false));
     $result = Cache::write('save_in_0', true, 'redisdb0');
     $exist = Cache::read('save_in_0', 'redisdb0');
     $this->assertTrue($result);
     $this->assertTrue($exist);
     $result = Cache::write('save_in_1', true, 'redisdb1');
     $this->assertTrue($result);
     $exist = Cache::read('save_in_0', 'redisdb1');
     $this->assertFalse($exist);
     $exist = Cache::read('save_in_1', 'redisdb1');
     $this->assertTrue($exist);
     Cache::delete('save_in_0', 'redisdb0');
     $exist = Cache::read('save_in_0', 'redisdb0');
     $this->assertFalse($exist);
     Cache::delete('save_in_1', 'redisdb1');
     $exist = Cache::read('save_in_1', 'redisdb1');
     $this->assertFalse($exist);
     Cache::drop('redisdb0');
     Cache::drop('redisdb1');
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:28,代码来源:RedisEngineTest.php

示例13: _createCacheConfig

 /**
  * Create the cache config for this component
  *
  * @return void
  */
 protected function _createCacheConfig()
 {
     if ($this->_isCacheEnabled()) {
         $cache = array('duration' => $this->cacheDuration, 'engine' => 'File', 'path' => CACHE);
         if (isset($this->settings['cache'])) {
             $cache = array_merge($cache, $this->settings['cache']);
         }
         Cache::drop('SassComponent');
         Cache::config('SassComponent', $cache);
     }
 }
开发者ID:ZakSchaffstall,项目名称:SassCompiler,代码行数:16,代码来源:SassComponent.php

示例14: testCachedRenderArrayConfig

 /**
  * Test cached render array config
  *
  * @return void
  */
 public function testCachedRenderArrayConfig()
 {
     $mock = $this->getMock('Cake\\Cache\\CacheEngine');
     $mock->method('init')->will($this->returnValue(true));
     $mock->method('read')->will($this->returnValue(false));
     $mock->expects($this->once())->method('write')->with('my_key', "dummy\n");
     Cache::config('cell', $mock);
     $cell = $this->View->cell('Articles', [], ['cache' => ['key' => 'my_key', 'config' => 'cell']]);
     $result = $cell->render();
     $this->assertEquals("dummy\n", $result);
     Cache::drop('cell');
 }
开发者ID:KarimaLadhani,项目名称:cakephp,代码行数:17,代码来源:CellTest.php

示例15: testWriteTriggerError

 /**
  * Test that failed writes cause errors to be triggered.
  *
  * @return void
  */
 public function testWriteTriggerError()
 {
     Configure::write('App.namespace', 'TestApp');
     Cache::config('test_trigger', ['engine' => 'TestAppCache', 'prefix' => '']);
     try {
         Cache::write('fail', 'value', 'test_trigger');
         $this->fail('No exception thrown');
     } catch (\PHPUnit_Framework_Error $e) {
         $this->assertTrue(true);
     }
     Cache::drop('test_trigger');
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:17,代码来源:CacheTest.php


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