本文整理汇总了PHP中sugar_cache_clear函数的典型用法代码示例。如果您正苦于以下问题:PHP sugar_cache_clear函数的具体用法?PHP sugar_cache_clear怎么用?PHP sugar_cache_clear使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sugar_cache_clear函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: testStoreClearCacheKeyAndRetrieve
public function testStoreClearCacheKeyAndRetrieve()
{
sugar_cache_put($this->_cacheKey1, $this->_cacheValue1);
sugar_cache_put($this->_cacheKey2, $this->_cacheValue2);
sugar_cache_clear($this->_cacheKey1);
$this->assertNotEquals($this->_cacheValue1, sugar_cache_retrieve($this->_cacheKey1));
$this->assertEquals($this->_cacheValue2, sugar_cache_retrieve($this->_cacheKey2));
}
开发者ID:thsonvt,项目名称:sugarcrm_dev,代码行数:8,代码来源:ExternalCacheAPITest.php
示例2: setUp
public function setUp()
{
if (!is_dir('custom/include/language')) {
@mkdir('custom/include/language', 0777, true);
}
sugar_cache_clear('app_list_strings.en_us');
sugar_cache_clear('app_list_strings.fr_test');
}
开发者ID:nickpro,项目名称:sugarcrm_dev,代码行数:8,代码来源:Bug22882Test.php
示例3: tearDown
public function tearDown()
{
unlink('include/language/fr_test.lang.php');
unlink('include/language/de_test.lang.php');
sugar_cache_clear('app_list_strings.en_us');
sugar_cache_clear('app_list_strings.fr_test');
sugar_cache_clear('app_list_strings.de_test');
if (isset($this->_backup_default_language)) {
$sugar_config['default_language'] = $this->_backup_default_language;
}
}
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:11,代码来源:Bug42427Test.php
示例4: clearCaches
public function clearCaches()
{
//Need to invalidate the caches for rolesets when roles change (availible modules may change)
if ($this->load_relationship('acl_role_sets')) {
$rolesets = $this->acl_role_sets->getBeans();
$mm = MetaDataManager::getManager();
foreach ($rolesets as $roleset) {
$context = new MetaDataContextRoleSet($roleset);
$mm->invalidateCache($mm->getPlatformsWithCaches(), $context);
}
}
sugar_cache_clear('ACL');
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:13,代码来源:ACLRole.php
示例5: tearDown
public function tearDown()
{
$_REQUEST = array();
sugar_cache_clear('mod_strings.en_us');
if (file_exists('custom/modules/' . $this->module . '/language/en_us.lang.php')) {
unlink('custom/modules/' . $this->module . '/language/en_us.lang.php');
}
if (file_exists('custom/modules/' . $this->add_module . '/language/en_us.lang.php')) {
unlink('custom/modules/' . $this->add_module . '/language/en_us.lang.php');
}
SugarTestHelper::tearDown();
parent::tearDown();
}
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:13,代码来源:Bug51172Test.php
示例6: display
function display()
{
global $mod_strings, $export_module, $current_language, $theme, $current_user;
echo get_module_title("Activities", $mod_strings['LBL_MODULE_TITLE'], true);
$mod_strings = return_module_language($current_language, 'Calls');
// Overload the export module since the user got here by clicking the "Activities" tab
$export_module = "Calls";
$_REQUEST['module'] = 'Calls';
$controller = ControllerFactory::getController('Calls');
$controller->loadBean();
$controller->preProcess();
$controller->process();
//Manipulate view directly to not display header, js and footer again
$view = ViewFactory::loadView($controller->view, $controller->module, $controller->bean, $controller->view_object_map);
$view->options['show_header'] = false;
$view->options['show_title'] = false;
$view->options['show_javascript'] = false;
$view->process();
if ($GLOBALS['external_cache_enabled']) {
sugar_cache_clear('VIEW_CONFIG_FILE_Calls_TYPE_list');
}
die;
}
开发者ID:klr2003,项目名称:sourceread,代码行数:23,代码来源:view.list.php
示例7: mark_deleted
/**
* Same as SugarBean::mark_deleted except clears api cache.
* @param $id
*/
public function mark_deleted($id)
{
sugar_cache_clear('currency_list');
$return = parent::mark_deleted($id);
// The per-module cache doesn't need to be cleared here
MetaDataManager::refreshSectionCache(array(MetaDataManager::MM_CURRENCIES));
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:11,代码来源:Currency.php
示例8: action_DeployPackage
function action_DeployPackage()
{
if (defined('TEMPLATE_URL')) {
sugar_cache_reset();
SugarTemplateUtilities::disableCache();
}
$mb = new ModuleBuilder();
$load = $_REQUEST['package'];
$message = $GLOBALS['mod_strings']['LBL_MODULE_DEPLOYED'];
if (!empty($load)) {
$zip = $mb->getPackage($load);
require_once 'ModuleInstall/PackageManager/PackageManager.php';
$pm = new PackageManager();
$info = $mb->packages[$load]->build(false);
mkdir_recursive($GLOBALS['sugar_config']['cache_dir'] . '/upload/upgrades/module/');
rename($info['zip'], $GLOBALS['sugar_config']['cache_dir'] . '/' . 'upload/upgrades/module/' . $info['name'] . '.zip');
copy($info['manifest'], $GLOBALS['sugar_config']['cache_dir'] . '/' . 'upload/upgrades/module/' . $info['name'] . '-manifest.php');
$_REQUEST['install_file'] = $GLOBALS['sugar_config']['cache_dir'] . '/' . 'upload/upgrades/module/' . $info['name'] . '.zip';
$GLOBALS['mi_remove_tables'] = false;
$pm->performUninstall($load);
//#23177 , js cache clear
clearAllJsAndJsLangFilesWithoutOutput();
//#30747, clear the cache in memoy
$cache_key = 'app_list_strings.' . $GLOBALS['current_language'];
sugar_cache_clear($cache_key);
sugar_cache_reset();
//clear end
$pm->performInstall($_REQUEST['install_file']);
}
echo 'complete';
}
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:controller.php
示例9: action_DeployPackage
function action_DeployPackage()
{
global $current_user;
if (defined('TEMPLATE_URL')) {
sugar_cache_reset();
SugarTemplateUtilities::disableCache();
}
//increment etag for menu so the new module shows up when the AJAX UI reloads
$current_user->incrementETag("mainMenuETag");
$mb = new ModuleBuilder();
$load = $_REQUEST['package'];
$message = $GLOBALS['mod_strings']['LBL_MODULE_DEPLOYED'];
if (!empty($load)) {
$zip = $mb->getPackage($load);
require_once 'ModuleInstall/PackageManager/PackageManager.php';
$pm = new PackageManager();
$info = $mb->packages[$load]->build(false);
$uploadDir = $pm->upload_dir . '/upgrades/module/';
mkdir_recursive($uploadDir);
rename($info['zip'], $uploadDir . $info['name'] . '.zip');
copy($info['manifest'], $uploadDir . $info['name'] . '-manifest.php');
$_REQUEST['install_file'] = $uploadDir . $info['name'] . '.zip';
$GLOBALS['mi_remove_tables'] = false;
$pm->performUninstall($load);
//#23177 , js cache clear
clearAllJsAndJsLangFilesWithoutOutput();
//#30747, clear the cache in memory
$cache_key = 'app_list_strings.' . $GLOBALS['current_language'];
sugar_cache_clear($cache_key);
sugar_cache_reset();
//clear end
$pm->performInstall($_REQUEST['install_file'], true);
//clear the unified_search_module.php file
require_once 'modules/Home/UnifiedSearchAdvanced.php';
UnifiedSearchAdvanced::unlinkUnifiedSearchModulesFile();
//bug 44269 - start
//clear workflow admin modules cache
if (isset($_SESSION['get_workflow_admin_modules_for_user'])) {
unset($_SESSION['get_workflow_admin_modules_for_user']);
}
//clear "is_admin_for_module" cache
$sessionVar = 'MLA_' . $current_user->user_name;
foreach ($mb->packages as $package) {
foreach ($package->modules as $module) {
$_SESSION[$sessionVar][$package->name . '_' . $module->name] = true;
}
}
//recreate acl cache
$actions = ACLAction::getUserActions($current_user->id, true);
//bug 44269 - end
}
echo 'complete';
}
开发者ID:butschster,项目名称:sugarcrm_dev,代码行数:53,代码来源:controller.php
示例10: save_custom_app_list_strings
/**
* @return bool
* @param app_list_strings array
* @desc Saves the app_list_strings to file in the 'custom' dir.
*/
function save_custom_app_list_strings(&$app_list_strings, $language)
{
$return_value = false;
$dirname = 'custom/include/language';
$dir_exists = is_dir($dirname);
if (!$dir_exists) {
$dir_exists = create_include_lang_dir($dirname);
}
if ($dir_exists) {
$filename = "{$dirname}/{$language}.lang.php";
$handle = @sugar_fopen($filename, 'wt');
if ($handle) {
$contents = create_dropdown_lang_pak_contents($app_list_strings, $language);
if (fwrite($handle, $contents)) {
$return_value = true;
$GLOBALS['log']->info("Successful write to: {$filename}");
}
fclose($handle);
} else {
$GLOBALS['log']->info("Unable to write edited language pak to file: {$filename}");
}
} else {
$GLOBALS['log']->info("Unable to create dir: {$dirname}");
}
if ($return_value) {
$cache_key = 'app_list_strings.' . $language;
sugar_cache_clear($cache_key);
}
return $return_value;
}
开发者ID:klr2003,项目名称:sourceread,代码行数:35,代码来源:Common.php
示例11: action_SaveLabel
public function action_SaveLabel()
{
if (!empty($_REQUEST['view_module']) && !empty($_REQUEST['labelValue'])) {
$_REQUEST["label_" . $_REQUEST['label']] = $_REQUEST['labelValue'];
// Since the following loop will change aspects of the $_REQUEST
// array read it into a copy to preserve state on $_REQUEST
$req = $_REQUEST;
foreach (ModuleBuilder::getModuleAliases($_REQUEST['view_module']) as $key) {
$req['view_module'] = $key;
$parser = new ParserLabel($req['view_module'], isset($req['view_package']) ? $req['view_package'] : null);
$parser->handleSave($req, $GLOBALS['current_language']);
// Clear the language cache to make sure the view picks up the latest
$cache_key = LanguageManager::getLanguageCacheKey($req['view_module'], $GLOBALS['current_language']);
sugar_cache_clear($cache_key);
}
MetaDataManager::refreshSectionCache(MetaDataManager::MM_LABELS);
MetaDataManager::refreshSectionCache(MetaDataManager::MM_ORDEREDLABELS);
}
$this->view = 'modulefields';
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:20,代码来源:controller.php
示例12: clearLanguageCache
/**
* Remove the language cache files from cache/modules/<module>/language
*/
public function clearLanguageCache()
{
global $mod_strings;
if ($this->show_output) {
echo "<h3>{$mod_strings['LBL_QR_CLEARLANG']}</h3>";
}
//clear cache using the list $module_list_from_cache
if (!empty($this->module_list) && is_array($this->module_list)) {
if (in_array(translate('LBL_ALL_MODULES'), $this->module_list)) {
LanguageManager::clearLanguageCache();
} else {
//use the modules selected thrut the select list.
foreach ($this->module_list as $module_name) {
LanguageManager::clearLanguageCache($module_name);
}
}
}
// Clear app* cache values too
if (!empty($GLOBALS['sugar_config']['languages'])) {
$languages = $GLOBALS['sugar_config']['languages'];
} else {
$languages = array($GLOBALS['current_language'] => $GLOBALS['current_language']);
}
foreach (array_keys($languages) as $language) {
sugar_cache_clear('app_strings.' . $language);
sugar_cache_clear('app_list_strings.' . $language);
}
}
开发者ID:thsonvt,项目名称:sugarcrm_dev,代码行数:31,代码来源:QuickRepairAndRebuild.php
示例13: testBuildMergeLink
public function testBuildMergeLink()
{
$this->_lvd->seed = new stdClass();
$this->_lvd->seed->module_dir = 'foobarfoobar';
$GLOBALS['current_user']->setPreference('mailmerge_on', 'on');
$settings_cache = sugar_cache_retrieve('admin_settings_cache');
if (empty($settings_cache)) {
$settings_cache = array();
}
$settings_cache['system_mailmerge_on'] = true;
sugar_cache_put('admin_settings_cache', $settings_cache);
$output = $this->_lvd->buildMergeLink(array('foobarfoobar' => 'foobarfoobar'));
$this->assertContains("index.php?action=index&module=MailMerge&entire=true", $output);
sugar_cache_clear('admin_settings_cache');
}
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:15,代码来源:ListViewDisplayTest.php
示例14: _clearCache
/**
* PRIVATE function used within clearLanguageCache so we do not repeat logic
* @param string module_dir the module_dir to clear
* @param string lang the name of the language file we are clearing this is for sugar_cache
*/
function _clearCache($module_dir = '', $lang)
{
if (!empty($module_dir) && !empty($lang)) {
$file = sugar_cached('modules/') . $module_dir . '/language/' . $lang . '.lang.php';
if (file_exists($file)) {
unlink($file);
$key = self::getLanguageCacheKey($module_dir, $lang);
sugar_cache_clear($key);
}
}
}
开发者ID:omusico,项目名称:sugar_work,代码行数:16,代码来源:LanguageManager.php
示例15: action_updatewirelessenabledmodules
public function action_updatewirelessenabledmodules()
{
require_once 'modules/Administration/Forms.php';
global $app_strings, $current_user, $moduleList;
if (!is_admin($current_user)) {
sugar_die($app_strings['ERR_NOT_ADMIN']);
}
require_once 'modules/Configurator/Configurator.php';
$configurator = new Configurator();
$configurator->saveConfig();
if (isset($_REQUEST['enabled_modules']) && !empty($_REQUEST['enabled_modules'])) {
$updated_enabled_modules = array();
$wireless_module_registry = array();
$file = 'include/MVC/Controller/wireless_module_registry.php';
if (SugarAutoLoader::fileExists($file)) {
require $file;
}
foreach (explode(',', $_REQUEST['enabled_modules']) as $moduleName) {
$moduleDef = array_key_exists($moduleName, $wireless_module_registry) ? $wireless_module_registry[$moduleName] : array();
$updated_enabled_modules[$moduleName] = $moduleDef;
}
$filename = create_custom_directory('include/MVC/Controller/wireless_module_registry.php');
mkdir_recursive(dirname($filename));
write_array_to_file('wireless_module_registry', $updated_enabled_modules, $filename);
foreach ($moduleList as $mod) {
sugar_cache_clear("CONTROLLER_wireless_module_registry_{$mod}");
}
//Users doesn't appear in the normal module list, but its value is cached on login.
sugar_cache_clear("CONTROLLER_wireless_module_registry_Users");
sugar_cache_reset();
// Bug 59121 - Clear the metadata cache for the mobile platform
MetaDataManager::refreshCache(array('mobile'));
}
echo "true";
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:35,代码来源:controller.php
示例16: __destruct
/**
* Destructor
* Here we'll write out the internal file path caches to an external cache of some sort.
*/
public function __destruct()
{
// Bug 28309 - Set the current directory to one which we expect it to be (i.e. the root directory of the install
set_include_path(realpath(dirname(__FILE__) . '/../..') . PATH_SEPARATOR . get_include_path());
chdir(realpath(dirname(__FILE__) . '/../..'));
// Bug 30807/30808 - Re-setup the external cache since the object isn't there when calling this method.
$GLOBALS['external_cache_checked'] = false;
check_cache();
// clear out the cache on destroy if we are asked to
if ($this->_clearCacheOnDestroy) {
if (is_file($GLOBALS['sugar_config']['cache_dir'] . $this->getFilePath() . '/pathCache.php')) {
unlink($GLOBALS['sugar_config']['cache_dir'] . $this->getFilePath() . '/pathCache.php');
}
if ($GLOBALS['external_cache_enabled'] && $GLOBALS['external_cache_type'] != 'base-in-memory') {
sugar_cache_clear('theme_' . $this->dirName . '_jsCache');
sugar_cache_clear('theme_' . $this->dirName . '_cssCache');
sugar_cache_clear('theme_' . $this->dirName . '_imageCache');
sugar_cache_clear('theme_' . $this->dirName . '_templateCache');
}
} elseif (!inDeveloperMode()) {
// push our cache into the sugar cache
if ($GLOBALS['external_cache_enabled'] && $GLOBALS['external_cache_type'] != 'base-in-memory') {
// only update the caches if they have been changed in this request
if (count($this->_jsCache) != $this->_initialCacheSize['jsCache']) {
sugar_cache_put('theme_' . $this->dirName . '_jsCache', $this->_jsCache);
}
if (count($this->_cssCache) != $this->_initialCacheSize['cssCache']) {
sugar_cache_put('theme_' . $this->dirName . '_cssCache', $this->_cssCache);
}
if (count($this->_imageCache) != $this->_initialCacheSize['imageCache']) {
sugar_cache_put('theme_' . $this->dirName . '_imageCache', $this->_imageCache);
}
if (count($this->_templateCache) != $this->_initialCacheSize['templateCache']) {
sugar_cache_put('theme_' . $this->dirName . '_templateCache', $this->_templateCache);
}
} elseif (count($this->_jsCache) != $this->_initialCacheSize['jsCache'] || count($this->_cssCache) != $this->_initialCacheSize['cssCache'] || count($this->_imageCache) != $this->_initialCacheSize['imageCache'] || count($this->_templateCache) != $this->_initialCacheSize['templateCache']) {
sugar_file_put_contents(create_cache_directory($this->getFilePath() . '/pathCache.php'), serialize(array('jsCache' => $this->_jsCache, 'cssCache' => $this->_cssCache, 'imageCache' => $this->_imageCache, 'templateCache' => $this->_templateCache)));
}
} elseif ($GLOBALS['external_cache_enabled']) {
sugar_cache_clear('theme_' . $this->dirName . '_jsCache');
sugar_cache_clear('theme_' . $this->dirName . '_cssCache');
sugar_cache_clear('theme_' . $this->dirName . '_imageCache');
sugar_cache_clear('theme_' . $this->dirName . '_templateCache');
}
}
开发者ID:klr2003,项目名称:sourceread,代码行数:49,代码来源:SugarTheme.php
示例17: _clearCache
/**
* PRIVATE function used within clearVardefCache so we do not repeat logic
* @param string module_dir the module_dir to clear
* @param string object_name the name of the object we are clearing this is for sugar_cache
*/
function _clearCache($module_dir = '', $object_name = '')
{
if (!empty($module_dir) && !empty($object_name)) {
if ($object_name == 'aCase') {
$object_name = 'Case';
}
$file = $GLOBALS['sugar_config']['cache_dir'] . 'modules/' . $module_dir . '/' . $object_name . 'vardefs.php';
if (file_exists($file)) {
unlink($file);
$key = "VardefManager.{$module_dir}.{$object_name}";
sugar_cache_clear($key);
}
}
}
开发者ID:klr2003,项目名称:sourceread,代码行数:19,代码来源:VardefManager.php
示例18: save
function save($check_notify = FALSE)
{
sugar_cache_clear('currency_list');
return parent::save($check_notify);
}
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:5,代码来源:Currency.php
示例19: saveSetting
function saveSetting($category, $key, $value)
{
$result = $this->db->query("SELECT count(*) AS the_count FROM config WHERE category = '{$category}' AND name = '{$key}'");
$row = $this->db->fetchByAssoc($result, -1, true);
$row_count = $row['the_count'];
if ($category . "_" . $key == 'ldap_admin_password' || $category . "_" . $key == 'proxy_password') {
$value = $this->encrpyt_before_save($value);
}
if ($row_count == 0) {
$result = $this->db->query("INSERT INTO config (value, category, name) VALUES ('{$value}','{$category}', '{$key}')");
} else {
$result = $this->db->query("UPDATE config SET value = '{$value}' WHERE category = '{$category}' AND name = '{$key}'");
}
sugar_cache_clear('admin_settings_cache');
return $this->db->getAffectedRowCount();
}
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:16,代码来源:Administration.php
示例20: EmailTemplate
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
********************************************************************************/
/*********************************************************************************
* Description: Saves an Account record and then redirects the browser to the
* defined return URL.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$focus = new EmailTemplate();
require_once 'include/formbase.php';
$focus = populateFromPost('', $focus);
require_once 'modules/EmailTemplates/EmailTemplateFormBase.php';
$form = new EmailTemplateFormBase();
sugar_cache_clear('select_array:' . $focus->object_name . 'namebase_module=\'' . $focus->base_module . '\'name');
if (isset($_REQUEST['inpopupwindow']) and $_REQUEST['inpopupwindow'] == true) {
$focus = $form->handleSave('', false, false);
//do not redirect.
$body1 = "\n\t\t<script type='text/javascript'>\n\t\t\tfunction refreshTemplates() {\n\t\t\t\twindow.opener.refresh_email_template_list('{$focus->id}','{$focus->name}')\n\t\t\t\twindow.close();\n\t\t\t}\n\n\t\t\trefreshTemplates();\n\t\t</script>";
echo $body1;
} else {
$form->handleSave('', true, false, true, 'download');
}
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:31,代码来源:Save.php
注:本文中的sugar_cache_clear函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论