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


PHP GeneralCache::forgetEntry方法代码示例

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


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

示例1: testForgetEntry

 /**
  * @depends testCanSetValueToCache
  */
 public function testForgetEntry()
 {
     if (MEMCACHE_ON) {
         GeneralCache::cacheEntry('somethingForTesting3', 10);
         $value = GeneralCache::getEntry('somethingForTesting3');
         $this->assertEquals(10, $value);
         GeneralCache::forgetEntry('somethingForTesting3');
         try {
             GeneralCache::getEntry('somethingForTesting3');
             $this->fail('NotFoundException exception is not thrown.');
         } catch (NotFoundException $e) {
             $this->assertTrue(true);
         }
     }
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:18,代码来源:GeneralCacheTest.php

示例2: unrestrictedDelete

 protected function unrestrictedDelete()
 {
     unset(self::$cachedModelsByName[$this->name]);
     GeneralCache::forgetEntry('CustomFieldData' . $this->name);
     return parent::unrestrictedDelete();
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:6,代码来源:CustomFieldData.php

示例3: setMetadata

 /**
  * Sets metadata for the model.
  * @see getDefaultMetadata()
  * @returns An array of metadata.
  */
 public static function setMetadata(array $metadata)
 {
     if (YII_DEBUG) {
         self::assertMetadataIsValid($metadata);
     }
     $className = get_called_class();
     foreach (array_reverse(RuntimeUtil::getClassHierarchy($className, static::$lastClassInBeanHeirarchy)) as $modelClassName) {
         if ($modelClassName::getCanHaveBean()) {
             if ($modelClassName::canSaveMetadata()) {
                 if (isset($metadata[$modelClassName])) {
                     try {
                         $globalMetadata = GlobalMetadata::getByClassName($modelClassName);
                     } catch (NotFoundException $e) {
                         $globalMetadata = new GlobalMetadata();
                         $globalMetadata->className = $modelClassName;
                     }
                     $globalMetadata->serializedMetadata = serialize($metadata[$modelClassName]);
                     $saved = $globalMetadata->save();
                     // TODO: decide how to deal with this properly if it fails.
                     //       ie: throw or return false, or something other than
                     //           this naughty assert.
                     assert('$saved');
                 }
             }
         }
     }
     self::forgetBeanModel(get_called_class());
     RedBeanModelsCache::forgetAllByModelType(get_called_class());
     GeneralCache::forgetEntry(get_called_class() . 'Metadata');
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:35,代码来源:RedBeanModel.php

示例4: forgetCacheEntryForTabMenuByUser

 /**
  * @param $user
  */
 public static function forgetCacheEntryForTabMenuByUser($user)
 {
     $identifier = self::getMenuViewItemsCacheIdentifierByUser($user);
     GeneralCache::forgetEntry($identifier);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:8,代码来源:MenuUtil.php

示例5: clearCache

 public static function clearCache($category, $languageCode)
 {
     assert('is_string($category)');
     assert('is_string($languageCode)');
     GeneralCache::forgetEntry(self::getMessageSourceCacheIdentifier($category, $languageCode));
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:6,代码来源:ZurmoMessageSource.php

示例6: setMetadata

 /**
  * Sets new metadata.
  * @param $metadata An array of metadata.
  * @param $user The current user.
  */
 public static function setMetadata(array $metadata, User $user = null)
 {
     $className = get_called_class();
     if (YII_DEBUG) {
         self::assertMetadataIsValid($metadata);
     }
     MetadataUtil::setMetadata($className, $metadata, $user);
     if ($user == null) {
         GeneralCache::forgetEntry($className . 'Metadata');
     }
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:16,代码来源:Module.php

示例7: handleImports

 /**
  * Import all files that need to be included(for lazy loading)
  * @param $event
  */
 public function handleImports($event)
 {
     //Clears file cache so that everything is clean.
     if (isset($_GET['clearCache']) && $_GET['clearCache'] == 1) {
         GeneralCache::forgetEntry('filesClassMap');
     }
     try {
         // not using default value to save cpu cycles on requests that follow the first exception.
         Yii::$classMap = GeneralCache::getEntry('filesClassMap');
     } catch (NotFoundException $e) {
         $filesToInclude = FileUtil::getFilesFromDir(Yii::app()->basePath . '/modules', Yii::app()->basePath . '/modules', 'application.modules');
         $filesToIncludeFromCore = FileUtil::getFilesFromDir(Yii::app()->basePath . '/core', Yii::app()->basePath . '/core', 'application.core');
         $totalFilesToIncludeFromModules = count($filesToInclude);
         foreach ($filesToIncludeFromCore as $key => $file) {
             $filesToInclude[$totalFilesToIncludeFromModules + $key] = $file;
         }
         foreach ($filesToInclude as $file) {
             Yii::import($file);
         }
         GeneralCache::cacheEntry('filesClassMap', Yii::$classMap);
     }
     Yii::app()->setAllClassesAreImported();
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:27,代码来源:BeginRequestBehavior.php

示例8: setMetadata

 public static function setMetadata(array $metadata)
 {
     if (YII_DEBUG) {
         self::assertMetadataIsValid($metadata);
     }
     // Save the mixed in Person metadata.
     if (isset($metadata['Person'])) {
         $modelClassName = 'Person';
         try {
             $globalMetadata = GlobalMetadata::getByClassName($modelClassName);
         } catch (NotFoundException $e) {
             $globalMetadata = new GlobalMetadata();
             $globalMetadata->className = $modelClassName;
         }
         $globalMetadata->serializedMetadata = serialize($metadata[$modelClassName]);
         $saved = $globalMetadata->save();
         assert('$saved');
     }
     if (isset($metadata['User'])) {
         parent::setMetadata($metadata);
     }
     GeneralCache::forgetEntry(get_called_class() . 'Metadata');
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:23,代码来源:User.php

示例9: flushModuleLabelTranslationParameters

 /**
  * Used by tests to reset value between tests.
  */
 public function flushModuleLabelTranslationParameters()
 {
     foreach (Yii::app()->params['supportedLanguages'] as $language => $notUsed) {
         GeneralCache::forgetEntry('moduleLabelTranslationParameters' . $language);
     }
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:9,代码来源:ZurmoLanguageHelper.php


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