當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Cache::drop方法代碼示例

本文整理匯總了PHP中Cache::drop方法的典型用法代碼示例。如果您正苦於以下問題:PHP Cache::drop方法的具體用法?PHP Cache::drop怎麽用?PHP Cache::drop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Cache的用法示例。


在下文中一共展示了Cache::drop方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: tearDown

/**
 * tearDown method
 *
 * @return void
 */
	public function tearDown() {
		parent::tearDown();
		Configure::write('Cache.disable', $this->_cacheDisable);
		Cache::drop('xcache');
		Cache::drop('xcache_groups');
		Cache::config('default');
	}
開發者ID:hungnt88,項目名稱:5stars-1,代碼行數:12,代碼來源:XcacheEngineTest.php

示例2: tearDown

/**
 * tearDown method
 *
 * @return void
 */
	public function tearDown() {
		Configure::write('Cache.disable', $this->_cacheDisable);
		Cache::drop('');
		Cache::drop('redis_groups');
		Cache::drop('redis_helper');
		Cache::config('default');
	}
開發者ID:hungnt88,項目名稱:5stars-1,代碼行數:12,代碼來源:RedisEngineTest.php

示例3: endTest

 /**
  * tearDown method
  *
  * @return void
  */
 public function endTest($method)
 {
     Cache::clear(false, 'database_test');
     Configure::write('Cache.disable', $this->_cacheDisable);
     Cache::drop('database_test');
     Cache::config('default');
     parent::endTest($method);
 }
開發者ID:hiromi2424,項目名稱:ninja,代碼行數:13,代碼來源:database.test.php

示例4: tearDown

 /**
  * end a test
  *
  * @return void
  **/
 function tearDown()
 {
     parent::tearDown();
     unset($this->Helper);
     Cache::delete(AssetConfig::CACHE_BUILD_TIME_KEY, AssetConfig::CACHE_CONFIG);
     Cache::drop(AssetConfig::CACHE_CONFIG);
     @unlink(TMP . AssetConfig::BUILD_TIME_FILE);
 }
開發者ID:nojimage,項目名稱:asset_compress,代碼行數:13,代碼來源:AssetCompressHelperTest.php

示例5: tearDown

 public function tearDown()
 {
     SlugCache::clear();
     SlugCache::config($this->slugCache);
     Configure::write('Cache.disable', $this->disabled);
     Cache::drop('SluggerTest');
     parent::tearDown();
 }
開發者ID:jeremyharris,項目名稱:slugger,代碼行數:8,代碼來源:SlugCacheTest.php

示例6: setUp

 function setUp()
 {
     Cache::drop(AssetConfig::CACHE_CONFIG);
     Cache::config(AssetConfig::CACHE_CONFIG, array('engine' => 'File'));
     $this->_pluginPath = App::pluginPath('AssetCompress');
     $this->testConfig = $this->_pluginPath . 'tests' . DS . 'test_files' . DS . 'config' . DS . 'config.ini';
     AssetConfig::clearAllCachedKeys();
     $this->config = AssetConfig::buildFromIniFile($this->testConfig);
 }
開發者ID:radig,項目名稱:asset_compress,代碼行數:9,代碼來源:asset_config.test.php

示例7: setUp

 public function setUp()
 {
     parent::setUp();
     $this->_config = Configure::read();
     Configure::write('Config.language', 'ja');
     Cache::drop('_cake_core_');
     I18n::clear();
     App::build(array('locales' => array(App::pluginPath('YamlReader') . 'Test' . DS . 'files' . DS . 'Locale' . DS)), true);
 }
開發者ID:hiromi2424,項目名稱:yaml_reader,代碼行數:9,代碼來源:I18nYamlReaderTest.php

示例8: tearDown

/**
 * end a test
 *
 * @return void
 */
	public function tearDown() {
		parent::tearDown();
		unset($this->Helper);

		Cache::delete(AssetConfig::CACHE_BUILD_TIME_KEY, AssetConfig::CACHE_CONFIG);
		Cache::drop(AssetConfig::CACHE_CONFIG);
		// @codingStandardsIgnoreStart
		@unlink(TMP . AssetConfig::BUILD_TIME_FILE);
		// @codingStandardsIgnoreEnd
	}
開發者ID:renan,項目名稱:asset_compress,代碼行數:15,代碼來源:AssetCompressHelperTest.php

示例9: setUp

 public function setUp()
 {
     parent::setUp();
     Cache::drop(AssetConfig::CACHE_CONFIG);
     Cache::config(AssetConfig::CACHE_CONFIG, array('engine' => 'File'));
     $this->_pluginPath = App::pluginPath('AssetCompress');
     $this->_testFiles = App::pluginPath('AssetCompress') . 'Test' . DS . 'test_files' . DS;
     $this->testConfig = $this->_testFiles . 'Config' . DS . 'config.ini';
     $this->_themeConfig = $this->_testFiles . 'Config' . DS . 'themed.ini';
     AssetConfig::clearAllCachedKeys();
     $this->config = AssetConfig::buildFromIniFile($this->testConfig);
 }
開發者ID:superstarrajini,項目名稱:cakepackages,代碼行數:12,代碼來源:AssetConfigTest.php

示例10: onLogin

	public function onLogin() {
		$hash = md5($this->id . ' ' . time() . ' ' . rand(1, 1000));
		$query = 'INSERT INTO `users_session` SET
			`user_id`=' . $this->id . ',
			`session`=\'' . $hash . '\',
			`expires`=' . (time() + Config::need('auth_cookie_lifetime')) . '
			ON DUPLICATE KEY UPDATE
			`session`=\'' . $hash . '\',
			`expires`=' . (time() + Config::need('auth_cookie_lifetime'));
		Database::query($query);
		Cache::drop('auth_' . $this->id);
		$this->setProperty('lastLogin', time());
		$this->setAuthCookie($hash);
	}
開發者ID:rasstroen,項目名稱:audio,代碼行數:14,代碼來源:CurrentUser.php

示例11: write

 function write()
 {
     global $current_user;
     /* @var $current_user CurrentUser */
     if ($current_user->authorized) {
         $mask = array('id' => 'int', 'bday' => 'string', 'city_id' => 'int', 'link_fb' => array('type' => 'string', '*' => true), 'link_vk' => array('type' => 'string', '*' => true), 'link_lj' => array('type' => 'string', '*' => true), 'link_tw' => array('type' => 'string', '*' => true), 'quote' => array('type' => 'string', '*' => true), 'about' => array('type' => 'string', '*' => true));
         $params = Request::checkPostParameters($mask);
         if ($current_user->id == $params['id']) {
             //avatar
             if (isset($_FILES['picture']) && $_FILES['picture']['tmp_name']) {
                 $filename = Config::need('avatar_upload_path') . '/' . $current_user->id . '.jpg';
                 $upload = new UploadAvatar($_FILES['picture']['tmp_name'], 100, 100, "simple", $filename);
                 if ($upload->out) {
                     $current_user->setProperty('picture', 1);
                 } else {
                     throw new Exception('cant copy file to ' . $filename, 100);
                 }
             }
             //bday
             $current_user->setProperty('bday', max(0, (int) @strtotime($params['bday'])));
             // city
             $current_user->setProperty('city_id', $params['city_id']);
             // facebook etc
             $current_user->setPropertySerialized('link_fb', $params['link_fb']);
             $current_user->setPropertySerialized('link_vk', $params['link_vk']);
             $current_user->setPropertySerialized('link_tw', $params['link_tw']);
             $current_user->setPropertySerialized('link_lj', $params['link_lj']);
             $params['quote'] = htmlspecialchars($params['quote']);
             $params['about'] = htmlspecialchars($params['about']);
             $current_user->setPropertySerialized('quote', $params['quote']);
             $current_user->setPropertySerialized('about', $params['about']);
             $current_user->save();
             // после редактирования профиля надо посбрасывать кеш со страницы профиля
             // и со страницы редактирования профиля
             // кеш в остальных модулях истечет сам
             Cache::drop(Request::$pageName . '_ProfileModule_' . $current_user->id, Cache::DATA_TYPE_XML);
             //xmlthemeDefault_ru_user_ProfileModule
             Cache::drop(Request::$pageName . '_ProfileModule_' . $current_user->id . 'edit', Cache::DATA_TYPE_XML);
             //xmlthemeDefault_ru_user_ProfileModule_19
         }
     }
 }
開發者ID:rasstroen,項目名稱:jma,代碼行數:42,代碼來源:ProfileWriteModule.php

示例12: testDrop

 /**
  * test that drop removes cache configs, and that further attempts to use that config
  * do not work.
  *
  * @return void
  */
 function testDrop()
 {
     App::build(array('libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS), 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)), true);
     $result = Cache::drop('some_config_that_does_not_exist');
     $this->assertFalse($result);
     $_testsConfig = Cache::config('tests');
     $result = Cache::drop('tests');
     $this->assertTrue($result);
     Cache::config('unconfigTest', array('engine' => 'TestAppCache'));
     $this->assertTrue(Cache::isInitialized('unconfigTest'));
     $this->assertTrue(Cache::drop('unconfigTest'));
     $this->assertFalse(Cache::isInitialized('TestAppCache'));
     Cache::config('tests', $_testsConfig);
     App::build();
 }
開發者ID:geethuann,項目名稱:assignment3,代碼行數:21,代碼來源:cache.test.php

示例13: dropCache

	public function dropCache($id) {
		Cache::drop($this->itemName . '_' . $id);
		unset($this->items[$id]);
	}
開發者ID:rasstroen,項目名稱:audio,代碼行數:4,代碼來源:Collection.php

示例14: testMaskSetting

 /**
  * Testing the mask setting in FileEngine
  *
  * @return void
  */
 public function testMaskSetting()
 {
     if (DS === '\\') {
         $this->markTestSkipped('File permission testing does not work on Windows.');
     }
     Cache::config('mask_test', array('engine' => 'File', 'path' => TMP . 'tests'));
     $data = 'This is some test content';
     $write = Cache::write('masking_test', $data, 'mask_test');
     $result = substr(sprintf('%o', fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
     $expected = '0664';
     $this->assertEquals($expected, $result);
     Cache::delete('masking_test', 'mask_test');
     Cache::drop('mask_test');
     Cache::config('mask_test', array('engine' => 'File', 'mask' => 0666, 'path' => TMP . 'tests'));
     $write = Cache::write('masking_test', $data, 'mask_test');
     $result = substr(sprintf('%o', fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
     $expected = '0666';
     $this->assertEquals($expected, $result);
     Cache::delete('masking_test', 'mask_test');
     Cache::drop('mask_test');
     Cache::config('mask_test', array('engine' => 'File', 'mask' => 0644, 'path' => TMP . 'tests'));
     $write = Cache::write('masking_test', $data, 'mask_test');
     $result = substr(sprintf('%o', fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
     $expected = '0644';
     $this->assertEquals($expected, $result);
     Cache::delete('masking_test', 'mask_test');
     Cache::drop('mask_test');
     Cache::config('mask_test', array('engine' => 'File', 'mask' => 0640, 'path' => TMP . 'tests'));
     $write = Cache::write('masking_test', $data, 'mask_test');
     $result = substr(sprintf('%o', fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
     $expected = '0640';
     $this->assertEquals($expected, $result);
     Cache::delete('masking_test', 'mask_test');
     Cache::drop('mask_test');
 }
開發者ID:rufl,項目名稱:ATP,代碼行數:40,代碼來源:FileEngineTest.php

示例15: testMultipleServers

 /**
  * testSettings method
  *
  * @access public
  * @return void
  */
 function testMultipleServers()
 {
     $servers = array('127.0.0.1:11211', '127.0.0.1:11222');
     $available = true;
     $Memcache =& new Memcache();
     foreach ($servers as $server) {
         list($host, $port) = explode(':', $server);
         if (!@$Memcache->connect($host, $port)) {
             $available = false;
         }
     }
     if ($this->skipIf(!$available, '%s Need memcache servers at ' . implode(', ', $servers) . ' to run this test')) {
         return;
     }
     $Memcache =& new MemcacheEngine();
     $Memcache->init(array('engine' => 'Memcache', 'servers' => $servers));
     $servers = array_keys($Memcache->__Memcache->getExtendedStats());
     $settings = $Memcache->settings();
     $this->assertEqual($servers, $settings['servers']);
     Cache::drop('dual_server');
 }
開發者ID:ambagasdowa,項目名稱:kml,代碼行數:27,代碼來源:memcache.test.php


注:本文中的Cache::drop方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。