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