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


PHP LanguageManager::clearLanguageCache方法代码示例

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


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

示例1: run

 public function run()
 {
     if (empty($this->upgrader->config['js_lang_version'])) {
         $this->upgrader->config['js_lang_version'] = 1;
     } else {
         $this->upgrader->config['js_lang_version'] += 1;
     }
     //remove lanugage cache files
     require_once 'include/SugarObjects/LanguageManager.php';
     LanguageManager::clearLanguageCache();
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:11,代码来源:3_RebuildJS.php

示例2: removeCustomLabels

 function removeCustomLabels()
 {
     $out = "";
     $languageDir = "custom/modules/{$this->module}/language";
     if (is_dir($languageDir)) {
         $files = scandir($languageDir);
         foreach ($files as $langFile) {
             if (substr($langFile, 0, 1) == '.') {
                 continue;
             }
             $language = substr($langFile, 0, strlen($langFile) - 9);
             unlink($languageDir . "/" . $langFile);
             LanguageManager::clearLanguageCache($this->module, $language);
             $out .= "Removed language file {$langFile}<br/>";
         }
     }
     return $out;
 }
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:18,代码来源:view.resetmodule.php

示例3: 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

示例4: deleteRelationship

 private function deleteRelationship($lhs_module, $rhs_module = null, $rel_name = null)
 {
     $rhs_module = $rhs_module == null ? $lhs_module : $rhs_module;
     $this->relationships = new DeployedRelationships($lhs_module);
     $this->relationships->delete($rel_name !== null ? $rel_name : $this->relationship->getName());
     $this->relationships->save();
     SugarRelationshipFactory::deleteCache();
     LanguageManager::clearLanguageCache($lhs_module);
     if ($lhs_module != $rhs_module) {
         LanguageManager::clearLanguageCache($rhs_module);
     }
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:12,代码来源:Bug53223Test.php

示例5: clearLanguageCaches

 /**
  * Clear all related language cache files.
  *
  * @return void
  */
 private function clearLanguageCaches()
 {
     //remove the js language files
     LanguageManager::removeJSLanguageFiles();
     //remove lanugage cache files
     LanguageManager::clearLanguageCache();
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:12,代码来源:RenameModules.php

示例6: tearDown_relation

 /**
  * Doing the same things like setUp but for initialized list of modules
  *
  * @static
  * @return bool are caches refreshed or not
  */
 protected static function tearDown_relation()
 {
     SugarRelationshipFactory::deleteCache();
     $modules = array_unique(self::$cleanModules);
     foreach ($modules as $module) {
         LanguageManager::clearLanguageCache($module);
     }
     self::tearDown('dictionary');
     VardefManager::$linkFields = array();
     VardefManager::clearVardef();
     foreach ($modules as $module) {
         VardefManager::refreshVardefs($module, BeanFactory::getBeanName($module));
     }
     SugarRelationshipFactory::rebuildCache();
     self::$cleanModules = array();
     return true;
 }
开发者ID:sunmo,项目名称:snowlotus,代码行数:23,代码来源:SugarTestHelper.php

示例7: addLabels

 static function addLabels($language, $labels, $moduleName, $basepath = null)
 {
     $GLOBALS['log']->debug("ParserLabel->addLabels({$language}, \$labels, {$moduleName}, {$basepath} );");
     $GLOBALS['log']->debug("\$labels:" . print_r($labels, true));
     $deployedModule = false;
     if (is_null($basepath)) {
         $deployedModule = true;
         $basepath = "custom/modules/{$moduleName}/language";
         if (!is_dir($basepath)) {
             require_once 'modules/Administration/Common.php';
             create_module_lang_dir($moduleName);
         }
     }
     $filename = "{$basepath}/{$language}.lang.php";
     $dir_exists = is_dir($basepath);
     $mod_strings = array();
     if ($dir_exists) {
         if (file_exists($filename)) {
             // obtain $mod_strings
             include $filename;
         }
     } else {
         return false;
     }
     $changed = false;
     //$charset = (isset($app_strings['LBL_CHARSET'])) ? $app_strings['LBL_CHARSET'] : $GLOBALS['sugar_config']['default_charset'] ;
     foreach ($labels as $key => $value) {
         if (!isset($mod_strings[$key]) || strcmp($value, $mod_strings[$key]) != 0) {
             $mod_strings[$key] = html_entity_decode_utf8($value, ENT_QUOTES);
             // must match encoding used in view.labels.php
             $changed = true;
         }
     }
     if ($changed) {
         $GLOBALS['log']->debug("ParserLabel->addLabels: writing new mod_strings to {$filename}");
         $GLOBALS['log']->debug("ParserLabel->addLabels: mod_strings=" . print_r($mod_strings, true));
         if (!write_array_to_file("mod_strings", $mod_strings, $filename)) {
             $GLOBALS['log']->fatal("Could not write {$filename}");
         } else {
             // if we have a cache to worry about, then clear it now
             if ($deployedModule) {
                 $GLOBALS['log']->debug("PaserLabel->addLabels: clearing language cache");
                 $cache_key = "module_language." . $language . $moduleName;
                 sugar_cache_clear($cache_key);
                 LanguageManager::clearLanguageCache($moduleName, $language);
             }
         }
     }
     return true;
 }
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:50,代码来源:parser.label.php

示例8: foreach

foreach ($_SESSION['sugarMergeRunResults'] as $mergeModule => $mergeModuleFileList) {
    if (!empty($mergeModuleFileList)) {
        $skipLayouts = false;
    }
}
$stepNext = $skipLayouts ? $_REQUEST['step'] + 2 : $_REQUEST['step'] + 1;
$stepCancel = -1;
$stepRecheck = $_REQUEST['step'];
$_SESSION['step'][$steps['files'][$_REQUEST['step']]] = $stop ? 'failed' : 'success';
// clear out the theme cache
if (!class_exists('SugarThemeRegistry')) {
    require_once 'include/SugarTheme/SugarTheme.php';
}
$themeObject = SugarThemeRegistry::current();
$styleJSFilePath = $GLOBALS['sugar_config']['cache_dir'] . $themeObject->getJSPath() . DIRECTORY_SEPARATOR . 'style-min.js';
if (file_exists($styleJSFilePath)) {
    logThis("Rebuilding style js file: {$styleJSFilePath}");
    unlink($styleJSFilePath);
    SugarThemeRegistry::current()->clearJSCache();
    SugarThemeRegistry::current()->getJS();
}
SugarThemeRegistry::buildRegistry();
SugarThemeRegistry::clearAllCaches();
//Clean out the language files
logThis("Rebuilding language cache");
sugar_cache_reset_full();
LanguageManager::clearLanguageCache();
// re-minify the JS source files
$_REQUEST['root_directory'] = getcwd();
$_REQUEST['js_rebuild_concat'] = 'rebuild';
require_once 'jssource/minify.php';
开发者ID:razorinc,项目名称:sugarcrm-example,代码行数:31,代码来源:commit.php

示例9: action_SaveRelationship

 public function action_SaveRelationship()
 {
     if (!empty($GLOBALS['current_user']) && empty($GLOBALS['modListHeader'])) {
         $GLOBALS['modListHeader'] = query_module_access_list($GLOBALS['current_user']);
     }
     if (empty($_REQUEST['view_package'])) {
         $relationships = new DeployedRelationships($_REQUEST['view_module']);
     } else {
         $mb = new ModuleBuilder();
         $module =& $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']);
         $relationships = new UndeployedRelationships($module->getModuleDir());
     }
     $relationships->addFromPost();
     // Since the build() call below will call save() again, save the rebuild
     // of relationship metadata for now
     $relationships->save(false);
     $GLOBALS['log']->debug("\n\nSTART BUILD");
     if (empty($_REQUEST['view_package'])) {
         $relationships->build();
         LanguageManager::clearLanguageCache($_REQUEST['view_module']);
     }
     $GLOBALS['log']->debug("\n\nEND BUILD");
     $this->view = 'relationships';
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:24,代码来源:controller.php

示例10: addLabels

 static function addLabels($currLanguage, $labels, $moduleName, $basepath = null)
 {
     $GLOBALS['log']->debug("ParserLabel->addLabels({$currLanguage}, \$labels, {$moduleName}, {$basepath} );");
     $GLOBALS['log']->debug("\$labels:" . print_r($labels, true));
     $languages = get_languages();
     foreach ($languages as $language => $langlabel) {
         $currentLabels = self::getCustomLabels($language, $moduleName, $basepath);
         if ($currentLabels === false) {
             return false;
         }
         //Unable to create a custom folder.
         $mod_strings = $currentLabels['labels'];
         $changed = false;
         foreach ($labels as $key => $value) {
             if (!isset($mod_strings[$key]) || strcmp($value, $mod_strings[$key]) != 0 && $language == $currLanguage) {
                 $mod_strings[$key] = html_entity_decode_utf8($value, ENT_QUOTES);
                 // must match encoding used in view.labels.php
                 $changed = true;
             }
         }
         if ($changed) {
             $GLOBALS['log']->debug("ParserLabel->addLabels: writing new mod_strings to {$currentLabels['file']}");
             $GLOBALS['log']->debug("ParserLabel->addLabels: mod_strings=" . print_r($mod_strings, true));
             if (!write_array_to_file("mod_strings", $mod_strings, $currentLabels["file"])) {
                 $GLOBALS['log']->fatal("Could not write {$currentLabels['file']}");
             } else {
                 // if we have a cache to worry about, then clear it now
                 if ($currentLabels['deployed']) {
                     $GLOBALS['log']->debug("PaserLabel->addLabels: clearing language cache");
                     $cache_key = "module_language." . $language . $moduleName;
                     sugar_cache_clear($cache_key);
                     LanguageManager::clearLanguageCache($moduleName, $language);
                 }
             }
         }
     }
     return true;
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:38,代码来源:parser.label.php

示例11: addLabels

 /**
  * Add a set of labels to the language pack for a module, deployed or undeployed
  * 
  * @param string $language Language key, for example 'en_us'
  * @param array $labels The labels to add in the form of an array of System label => Display label pairs
  * @param string $moduleName Name of the module to which to add these labels
  * @param string $basepath Basepath to the file to be written to
  */
 public static function addLabels($language, $labels, $moduleName, $basepath = null)
 {
     $GLOBALS['log']->debug("ParserLabel->addLabels({$language}, \$labels, {$moduleName}, {$basepath});");
     $GLOBALS['log']->debug("\$labels:" . print_r($labels, true));
     $deployedModule = false;
     if (is_null($basepath)) {
         $deployedModule = true;
         $basepath = "custom/Extension/modules/{$moduleName}/Ext/Language";
         if (!SugarAutoLoader::fileExists($basepath)) {
             mkdir_recursive($basepath);
         }
     }
     $filename = "{$basepath}/{$language}.lang.php";
     $mod_strings = array();
     $changed = false;
     if (SugarAutoLoader::fileExists($basepath)) {
         if (SugarAutoLoader::fileExists($filename)) {
             // Get the current $mod_strings
             include $filename;
         }
         foreach ($labels as $key => $value) {
             if (!isset($mod_strings[$key]) || strcmp($value, $mod_strings[$key]) != 0) {
                 // Must match encoding used in view.labels.php
                 $mod_strings[$key] = to_html(strip_tags(from_html($value)));
                 $changed = true;
             }
         }
     } else {
         $changed = true;
     }
     if (!empty($mod_strings) && $changed) {
         $GLOBALS['log']->debug("ParserLabel->addLabels: writing new mod_strings to {$filename}");
         $GLOBALS['log']->debug("ParserLabel->addLabels: mod_strings=" . print_r($mod_strings, true));
         $write = "<?php\n// WARNING: The contents of this file are auto-generated.\n";
         // We can't use normal array writing here since multiple files can be
         // structured differently. This is dirty, yes, but necessary.
         foreach ($mod_strings as $k => $v) {
             $write .= "\$mod_strings['{$k}'] = " . var_export($v, 1) . ";\n";
         }
         if (!SugarAutoLoader::put($filename, $write, true)) {
             $GLOBALS['log']->fatal("Could not write {$filename}");
         } else {
             // if we have a cache to worry about, then clear it now
             if ($deployedModule) {
                 SugarCache::cleanOpcodes();
                 $GLOBALS['log']->debug("PaserLabel->addLabels: clearing language cache");
                 self::rebuildLanguageExtensions($language, $moduleName);
                 $cache_key = "module_language." . $language . $moduleName;
                 sugar_cache_clear($cache_key);
                 LanguageManager::clearLanguageCache($moduleName, $language);
                 MetaDataManager::refreshLanguagesCache($language);
             }
         }
     }
     return true;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:64,代码来源:parser.label.php

示例12: addLabels

    static function addLabels ($language , $labels , $moduleName , $basepath = null, $forRelationshipLabel = false)
    {

        $GLOBALS [ 'log' ]->debug ( "ParserLabel->addLabels($language, \$labels, $moduleName, $basepath );" ) ;
        $GLOBALS [ 'log' ]->debug ( "\$labels:" . print_r ( $labels, true ) ) ;

        $deployedModule = false ;
        if (is_null ( $basepath ))
        {
            $deployedModule = true ;
            $basepath = "custom/modules/$moduleName/language" ;
            if($forRelationshipLabel){
            	$basepath = "custom/modules/$moduleName/Ext/Language" ;
            }
            if (! is_dir ( $basepath ))
            {
                mkdir_recursive($basepath);
            }
        }

        $filename = "$basepath/$language.lang.php" ;
        if($forRelationshipLabel){
        	$filename = "$basepath/$language.lang.ext.php" ;
     	}
        $dir_exists = is_dir ( $basepath ) ;

        $mod_strings = array ( ) ;

        if ($dir_exists)
        {
            if (file_exists ( $filename ))
            {
                // obtain $mod_strings
                include ($filename) ;
            }else if($forRelationshipLabel){
            	$fh = fopen ($filename, 'a');
            	fclose($fh);
            }
        } else
        {
            return false ;
        }

        	$changed = false ;

        //$charset = (isset($app_strings['LBL_CHARSET'])) ? $app_strings['LBL_CHARSET'] : $GLOBALS['sugar_config']['default_charset'] ;

	        foreach ( $labels as $key => $value )
	        {
            if (! isset ( $mod_strings [ $key ] ) || strcmp ( $value, $mod_strings [ $key ] ) != 0)
	            {
                    $mod_strings [$key] = to_html(strip_tags(from_html($value))); // must match encoding used in view.labels.php
	                $changed = true ;
	            }
	        }

	        if ($changed)
	        {
            $GLOBALS [ 'log' ]->debug ( "ParserLabel->addLabels: writing new mod_strings to $filename" ) ;
	            $GLOBALS [ 'log' ]->debug ( "ParserLabel->addLabels: mod_strings=".print_r($mod_strings,true) ) ;
            if (! write_array_to_file ( "mod_strings", $mod_strings, $filename ))
	            {
                $GLOBALS [ 'log' ]->fatal ( "Could not write $filename" ) ;
	            } else
	            {
	                // if we have a cache to worry about, then clear it now
                if ($deployedModule)
	                {
                            SugarCache::cleanOpcodes();
	                    $GLOBALS [ 'log' ]->debug ( "PaserLabel->addLabels: clearing language cache" ) ;
	                    $cache_key = "module_language." . $language . $moduleName ;
	                    sugar_cache_clear ( $cache_key ) ;
	                    LanguageManager::clearLanguageCache ( $moduleName, $language ) ;
	                }
	            }
	        }

        // Fix for bug #51
        // when the label is recreated it defaults back to the original value (In this case its "User").

        // Solution:
        // 1. Changes to the label names should go to custom/Extension/modules/{ModuleName}/Ext/Language
        // This is done in case different users edit the same Relationship concurrently.
        // The changes from custom/Extension/modules/{ModuleName}/Ext/Language
        // will overwrite stuff in custom/modules/{ModuleName}/Ext/Language/en_us.lang.ext.php after
        //  Quick Repair and Rebuild is applied.
        if($forRelationshipLabel) {
            if(!empty($_POST[view_module]) && !empty($_POST[relationship_name]) && !empty($_POST[rhs_label]) && !empty($_POST[lhs_module])) {
                // 1. Overwrite custom/Extension/modules/{ModuleName}/Ext/Language
                $extension_basepath = "custom/Extension/modules/" . $_POST[view_module] . "/Ext/Language";
                mkdir_recursive($extension_basepath);

                $headerString = "<?php\n//THIS FILE IS AUTO GENERATED, DO NOT MODIFY\n";
                $out = $headerString;

                $extension_filename = "$extension_basepath/$language.custom" . $_POST[relationship_name] . ".php";

                $mod_strings = array();
                if (file_exists($extension_filename)) {
                    // obtain $mod_strings
//.........这里部分代码省略.........
开发者ID:auf,项目名称:crm_auf_org,代码行数:101,代码来源:parser.label.php

示例13: rebuild_js_lang

function rebuild_js_lang()
{
    require_once 'include/utils/file_utils.php';
    global $sugar_config;
    $jsFiles = array();
    getFiles($jsFiles, $sugar_config['cache_dir'] . 'jsLanguage');
    foreach ($jsFiles as $file) {
        unlink($file);
    }
    if (empty($sugar_config['js_lang_version'])) {
        $sugar_config['js_lang_version'] = 1;
    } else {
        $sugar_config['js_lang_version'] += 1;
    }
    write_array_to_file("sugar_config", $sugar_config, "config.php");
    //remove lanugage cache files
    require_once 'include/SugarObjects/LanguageManager.php';
    LanguageManager::clearLanguageCache();
}
开发者ID:JimMackin,项目名称:SuiteCRM-Build-Maker,代码行数:19,代码来源:upgrade_utils.php

示例14: action_SaveRelationship

 function action_SaveRelationship()
 {
     if (!empty($GLOBALS['current_user']) && empty($GLOBALS['modListHeader'])) {
         $GLOBALS['modListHeader'] = query_module_access_list($GLOBALS['current_user']);
     }
     if (empty($_REQUEST['view_package'])) {
         require_once 'modules/ModuleBuilder/parsers/relationships/DeployedRelationships.php';
         $relationships = new DeployedRelationships($_REQUEST['view_module']);
     } else {
         $mb = new ModuleBuilder();
         $module =& $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']);
         require_once 'modules/ModuleBuilder/parsers/relationships/UndeployedRelationships.php';
         $relationships = new UndeployedRelationships($module->getModuleDir());
     }
     $relationships->addFromPost();
     $relationships->save();
     $GLOBALS['log']->debug("\n\nSTART BUILD");
     if (empty($_REQUEST['view_package'])) {
         $relationships->build();
         LanguageManager::clearLanguageCache($_REQUEST['view_module']);
     }
     $GLOBALS['log']->debug("\n\nEND BUILD");
     $this->view = 'relationships';
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:24,代码来源:controller.php

示例15: 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);
             }
         }
     }
 }
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:21,代码来源:QuickRepairAndRebuild.php


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