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


PHP GeneralCache::cacheEntry方法代码示例

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


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

示例1: setAsProcessed

 public static function setAsProcessed($tableName, $identifier)
 {
     $processedTables = static::resolveProcessedTableNames($identifier);
     if (!in_array($tableName, $processedTables)) {
         $processedTables[] = $tableName;
         GeneralCache::cacheEntry($identifier, $processedTables);
     }
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:8,代码来源:ProcessedTableCache.php

示例2: cacheEntry

 public static function cacheEntry($identifier, $entry)
 {
     assert('is_string($entry) || is_numeric($entry)');
     parent::cacheEntry($identifier, $entry);
     if (static::supportsAndAllowsDatabaseCaching()) {
         ZurmoRedBean::exec("insert into actual_rights_cache\n                             (identifier, entry) values ('" . $identifier . "', '" . $entry . "') on duplicate key\n                             update entry = " . $entry);
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:8,代码来源:RightsCache.php

示例3: save

 /**
  * Any changes to the model must be re-cached.
  * @see RedBeanModel::save()
  */
 public function save($runValidation = true, array $attributeNames = null)
 {
     $saved = parent::save($runValidation, $attributeNames);
     if ($saved) {
         GeneralCache::cacheEntry('CustomFieldData' . $this->name, $this);
     }
     return $saved;
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:12,代码来源:CustomFieldData.php

示例4: testCanSetNullValueToCache

 public function testCanSetNullValueToCache()
 {
     //if memcache is off this test will fail because memcache will not cache null values.
     if (MEMCACHE_ON) {
         GeneralCache::cacheEntry('somethingForTesting', null);
         $value = GeneralCache::getEntry('somethingForTesting');
         $this->assertNull($value);
     }
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:9,代码来源:GeneralCacheTest.php

示例5: getReadSubscriptionModelClassNames

 /**
  * Get all read subscription model class names
  * @return array|mixed
  */
 public static function getReadSubscriptionModelClassNames()
 {
     try {
         return GeneralCache::getEntry('readPermissionsSubscriptionModelClassNames');
     } catch (NotFoundException $e) {
         $readPermissionsSubscriptionModelClassNames = self::findReadSubscriptionModelClassNames();
         GeneralCache::cacheEntry('readPermissionsSubscriptionModelClassNames', $readPermissionsSubscriptionModelClassNames);
         return $readPermissionsSubscriptionModelClassNames;
     }
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:14,代码来源:ReadPermissionsSubscriptionUtil.php

示例6: resolveByCacheAndGetVisibleAndOrderedAdminTabMenuByUser

 /**
  * @param $user
  * @return array|mixed
  */
 public static function resolveByCacheAndGetVisibleAndOrderedAdminTabMenuByUser($user)
 {
     assert('$user instanceof User && $user != null');
     try {
         $items = GeneralCache::getEntry(self::getAdminMenuViewItemsCacheIdentifier());
     } catch (NotFoundException $e) {
         $items = self::getVisibleAndOrderedAdminTabMenuByUser($user);
         GeneralCache::cacheEntry(self::getAdminMenuViewItemsCacheIdentifier(), $items);
     }
     return $items;
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:15,代码来源:MenuUtil.php

示例7: getGlobalSearchScopingModuleNamesAndLabelsDataByUser

 /**
  * Given a user, return an array of module names and their translated labels, for which the user
  * has the right to access and only modules that support the global search.
  * @param  User $user
  * @return array of module names and labels.
  */
 public static function getGlobalSearchScopingModuleNamesAndLabelsDataByUser(User $user)
 {
     assert('$user->id > 0');
     try {
         return GeneralCache::getEntry(self::getGlobalSearchScopingCacheIdentifier($user));
     } catch (NotFoundException $e) {
         $moduleNamesAndLabels = self::findGlobalSearchScopingModuleNamesAndLabelsDataByUser($user);
         GeneralCache::cacheEntry(self::getGlobalSearchScopingCacheIdentifier($user), $moduleNamesAndLabels);
         return $moduleNamesAndLabels;
     }
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:17,代码来源:GlobalSearchUtil.php

示例8: loadMessages

 /**
  * Override of the parent method because of problems with Yii's default cache
  * @see CDbMessageSource::loadMessages()
  * @param string $category
  * @param string $languageCode
  * @return array $messages
  */
 protected function loadMessages($category, $languageCode)
 {
     assert('is_string($category)');
     assert('is_string($languageCode)');
     try {
         $messages = GeneralCache::getEntry(self::getMessageSourceCacheIdentifier($category, $languageCode));
     } catch (NotFoundException $e) {
         $messages = $this->loadMessagesFromDb($category, $languageCode);
         GeneralCache::cacheEntry(self::getMessageSourceCacheIdentifier($category, $languageCode), $messages);
     }
     return $messages;
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:19,代码来源:ZurmoMessageSource.php

示例9: handleImports

 /**
  * Import all files that need to be included(for lazy loading)
  * @param $event
  */
 public function handleImports($event)
 {
     try {
         $filesToInclude = GeneralCache::getEntry('filesToIncludeForTests');
     } catch (NotFoundException $e) {
         $filesToInclude = FileUtil::getFilesFromDir(Yii::app()->basePath . '/modules', Yii::app()->basePath . '/modules', 'application.modules', true);
         $filesToIncludeFromFramework = FileUtil::getFilesFromDir(Yii::app()->basePath . '/core', Yii::app()->basePath . '/core', 'application.core', true);
         $totalFilesToIncludeFromModules = count($filesToInclude);
         foreach ($filesToIncludeFromFramework as $key => $file) {
             $filesToInclude[$totalFilesToIncludeFromModules + $key] = $file;
         }
         GeneralCache::cacheEntry('filesToIncludeForTests', $filesToInclude);
     }
     foreach ($filesToInclude as $file) {
         Yii::import($file);
     }
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:21,代码来源:BeginRequestTestBehavior.php

示例10: getMungableModelClassNames

 public static function getMungableModelClassNames()
 {
     try {
         return GeneralCache::getEntry('mungableModelClassNames');
     } catch (NotFoundException $e) {
         $mungableClassNames = self::findMungableModelClassNames();
         GeneralCache::cacheEntry('mungableModelClassNames', $mungableClassNames);
         return $mungableClassNames;
     }
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:10,代码来源:ReadPermissionsOptimizationUtil.php

示例11: getMetadata

 /**
  * Returns metadata for the module.
  * @see getDefaultMetadata()
  * @param $user The current user.
  * @returns An array of metadata.
  */
 public static function getMetadata(User $user = null)
 {
     $className = get_called_class();
     if ($user == null) {
         try {
             // not using default value to save cpu cycles on requests that follow the first exception.
             return GeneralCache::getEntry($className . 'Metadata');
         } catch (NotFoundException $e) {
         }
     }
     $metadata = MetadataUtil::getMetadata($className, $user);
     if (YII_DEBUG) {
         $className::assertMetadataIsValid($metadata);
     }
     if ($user == null) {
         GeneralCache::cacheEntry($className . 'Metadata', $metadata);
     }
     return $metadata;
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:25,代码来源:Module.php

示例12: setMetadata

 /**
  * @param array $metadata
  */
 public static function setMetadata(array $metadata)
 {
     $className = get_called_class();
     if (YII_DEBUG) {
         $className::assertMetadataIsValid($metadata);
     }
     MetadataUtil::setMetadata($className, $metadata);
     GeneralCache::cacheEntry($className . 'Metadata', $metadata);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:12,代码来源:ModelToComponentRules.php

示例13: testForgetAllNotDeleteOtherDataFromCache

 public function testForgetAllNotDeleteOtherDataFromCache()
 {
     if (MEMCACHE_ON && !PHP_CACHING_ON) {
         GeneralCache::cacheEntry('somethingForTesting4', 34);
         $value = GeneralCache::getEntry('somethingForTesting4');
         $this->assertEquals(34, $value);
         $originalAdditionalStringForCachePrefix = GeneralCache::getAdditionalStringForCachePrefix();
         GeneralCache::setAdditionalStringForCachePrefix('ATEST');
         GeneralCache::cacheEntry('somethingForTesting4', 43);
         $value = GeneralCache::getEntry('somethingForTesting4');
         $this->assertEquals(43, $value);
         GeneralCache::forgetAll();
         try {
             GeneralCache::getEntry('somethingForTesting4');
             $this->fail('NotFoundException exception is not thrown.');
         } catch (NotFoundException $e) {
             $this->assertTrue(true);
         }
         GeneralCache::setAdditionalStringForCachePrefix($originalAdditionalStringForCachePrefix);
         $value = GeneralCache::getEntry('somethingForTesting4');
         $this->assertEquals(34, $value);
     }
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:23,代码来源:GeneralCacheTest.php

示例14: registerUniqueIndexByMemberName

 protected static function registerUniqueIndexByMemberName($member, $modelClassName)
 {
     $indexName = RedBeanModelMemberIndexMetadataAdapter::resolveRandomIndexName($member, true);
     $uniqueIndexes = GeneralCache::getEntry(static::CACHE_KEY, array());
     $uniqueIndexes[$modelClassName][$indexName] = array('members' => array($member), 'unique' => true);
     GeneralCache::cacheEntry(static::CACHE_KEY, $uniqueIndexes);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:7,代码来源:RedBeanModelMemberRulesToColumnAdapter.php

示例15: setCacheIncrementValue

 /**
  * @param string $cacheType
  * @param mixed $value
  */
 protected static function setCacheIncrementValue($cacheType, $value)
 {
     GeneralCache::cacheEntry(static::$cacheIncrementValueVariableName . $cacheType, $value);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:8,代码来源:ZurmoCache.php


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