本文整理汇总了PHP中GeneralCache类的典型用法代码示例。如果您正苦于以下问题:PHP GeneralCache类的具体用法?PHP GeneralCache怎么用?PHP GeneralCache使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GeneralCache类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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('NamedSecurableItem' . $this->name, $this);
}
return $saved;
}
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:12,代码来源:NamedSecurableItem.php
示例2: unserialize
public static function &get($id)
{
if (GeneralCache::find($id)) {
$data =& unserialize(file_get_contents("/tmp/hcache-{$id}"));
return $data;
}
return false;
}
开发者ID:slepp,项目名称:pastebin.ca,代码行数:8,代码来源:Caching.class.php
示例3: 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
示例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: 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
示例7: forgetAllCaches
public static function forgetAllCaches()
{
RedBeanModelsCache::forgetAll();
RedBeansCache::forgetAll();
PermissionsCache::forgetAll();
RightsCache::forgetAll();
PoliciesCache::forgetAll();
GeneralCache::forgetAll();
BeanModelCache::forgetAll();
Currency::resetCaches();
//php only cache
}
开发者ID:youprofit,项目名称:Zurmo,代码行数:12,代码来源:ForgetAllCacheUtil.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: tearDownAfterClass
public static function tearDownAfterClass()
{
if (RedBeanDatabase::isFrozen()) {
TestDatabaseUtil::deleteRowsFromAllTablesExceptLog();
} else {
TestDatabaseUtil::deleteAllTablesExceptLog();
}
RedBeanModel::forgetAll();
RedBeanDatabase::close();
assert('!RedBeanDatabase::isSetup()');
// Not Coding Standard
GeneralCache::forgetAll();
}
开发者ID:youprofit,项目名称:Zurmo,代码行数:13,代码来源:BaseTest.php
示例10: 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
示例11: resolveCustomMetadataAndLoad
public static function resolveCustomMetadataAndLoad()
{
$shouldSaveZurmoModuleMetadata = false;
$metadata = ZurmoModule::getMetadata();
//Add Material to Menu if it doesn't exist
if (!in_array('costbook', $metadata['global']['tabMenuItemsModuleOrdering'])) {
$metadata['global']['tabMenuItemsModuleOrdering'][] = 'costbook';
$shouldSaveZurmoModuleMetadata = true;
}
if (!in_array('departmentReferences', $metadata['global']['tabMenuItemsModuleOrdering'])) {
$metadata['global']['tabMenuItemsModuleOrdering'][] = 'departmentReferences';
$shouldSaveZurmoModuleMetadata = true;
}
if (!in_array('agreements', $metadata['global']['tabMenuItemsModuleOrdering'])) {
$metadata['global']['tabMenuItemsModuleOrdering'][] = 'agreements';
$shouldSaveZurmoModuleMetadata = true;
}
if (!in_array('agreementProducts', $metadata['global']['tabMenuItemsModuleOrdering'])) {
$metadata['global']['tabMenuItemsModuleOrdering'][] = 'agreementProducts';
$shouldSaveZurmoModuleMetadata = true;
}
if (!in_array('opportunityProducts', $metadata['global']['tabMenuItemsModuleOrdering'])) {
$metadata['global']['tabMenuItemsModuleOrdering'][] = 'opportunityProducts';
$shouldSaveZurmoModuleMetadata = true;
}
if (!in_array('categories', $metadata['global']['tabMenuItemsModuleOrdering'])) {
$metadata['global']['tabMenuItemsModuleOrdering'][] = 'categories';
$shouldSaveZurmoModuleMetadata = true;
}
if ($shouldSaveZurmoModuleMetadata) {
ZurmoModule::setMetadata($metadata);
GeneralCache::forgetAll();
}
Yii::import('application.extensions.zurmoinc.framework.data.*');
$defaultDataMaker = new AgreementsDefaultDataMaker();
$defaultDataMaker->make();
$defaultDataMaker = new CostbooksDefaultDataMaker();
$defaultDataMaker->make();
$defaultDataMaker = new OpportunitiesDefaultDataMaker();
$defaultDataMaker->make();
}
开发者ID:RamaKavanan,项目名称:BaseVersion,代码行数:41,代码来源:CustomextInstallUtil.php
示例12: resolveCustomMetadataAndLoad
public static function resolveCustomMetadataAndLoad()
{
$shouldSaveZurmoModuleMetadata = false;
$metadata = ZurmoModule::getMetadata();
if (!in_array('animals', $metadata['global']['tabMenuItemsModuleOrdering'])) {
$metadata['global']['tabMenuItemsModuleOrdering'][] = 'animals';
$shouldSaveZurmoModuleMetadata = true;
}
if ($shouldSaveZurmoModuleMetadata) {
ZurmoModule::setMetadata($metadata);
GeneralCache::forgetAll();
}
$metadata = Activity::getMetadata();
if (!in_array('Animal', $metadata['Activity']['activityItemsModelClassNames'])) {
$metadata['Activity']['activityItemsModelClassNames'][] = 'Animal';
Activity::setMetadata($metadata);
GeneralCache::forgetAll();
}
Yii::import('application.extensions.zurmoinc.framework.data.*');
Yii::import('application.modules.animals.data.*');
$defaultDataMaker = new AnimalsDefaultDataMaker();
$defaultDataMaker->make();
}
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:23,代码来源:ZurmoZooInstallUtil.php
示例13: forgetAll
public static function forgetAll()
{
GeneralCache::forgetAll();
}
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:4,代码来源:PoliciesCache.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: getServerInfo
/**
* Downloads the l10n info XML file
*
* @return SimpleXMLElement
*/
protected static function getServerInfo()
{
if (self::$l10nInfo && isset(self::$l10nInfo) && self::$l10nInfo->version == '1.1') {
return self::$l10nInfo;
}
$cacheIdentifier = 'l10nServerInfo';
try {
self::$l10nInfo = GeneralCache::getEntry($cacheIdentifier);
} catch (NotFoundException $e) {
$infoFileUrl = self::$serverDomain . '/' . self::$infoXmlPath;
$xml = simplexml_load_file($infoFileUrl);
self::$l10nInfo = json_decode(json_encode($xml));
GeneralCache::cacheEntry($cacheIdentifier, self::$l10nInfo);
}
if (isset(self::$l10nInfo->version) && self::$l10nInfo->version == '1.1') {
return self::$l10nInfo;
}
throw new FailedServiceException();
}
开发者ID:youprofit,项目名称:Zurmo,代码行数:24,代码来源:ZurmoTranslationServerUtil.php
示例16: getNonMonitorJobClassNames
public static function getNonMonitorJobClassNames()
{
try {
$jobClassNames = GeneralCache::getEntry(self::NON_MONITOR_JOBS_CACHE_ID);
} catch (NotFoundException $e) {
$jobClassNames = array();
$modules = Module::getModuleObjects();
foreach ($modules as $module) {
$jobsClassNames = $module::getAllClassNamesByPathFolder('jobs');
foreach ($jobsClassNames as $jobClassName) {
$classToEvaluate = new ReflectionClass($jobClassName);
if (is_subclass_of($jobClassName, 'BaseJob') && !$classToEvaluate->isAbstract() && $jobClassName != 'MonitorJob') {
$jobClassNames[] = $jobClassName;
}
}
}
GeneralCache::cacheEntry(self::NON_MONITOR_JOBS_CACHE_ID, $jobClassNames);
}
return $jobClassNames;
}
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:20,代码来源:JobsToJobsCollectionViewUtil.php
示例17: unrestrictedDelete
protected function unrestrictedDelete()
{
unset(self::$cachedModelsByName[$this->name]);
GeneralCache::forgetEntry('CustomFieldData' . $this->name);
return parent::unrestrictedDelete();
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:6,代码来源:CustomFieldData.php
示例18: 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
示例19: 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
示例20: forgetCacheEntryForTabMenuByUser
/**
* @param $user
*/
public static function forgetCacheEntryForTabMenuByUser($user)
{
$identifier = self::getMenuViewItemsCacheIdentifierByUser($user);
GeneralCache::forgetEntry($identifier);
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:8,代码来源:MenuUtil.php
注:本文中的GeneralCache类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论