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


PHP LanguageManager::_clearCache方法代码示例

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


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

示例1: clearLanguageCache

 /**
  * clear out the language cache.
  * @param string module_dir the module_dir to clear, if not specified then clear
  *                      clear language cache for all modules.
  * @param string lang the name of the object we are clearing this is for sugar_cache
  */
 public static function clearLanguageCache($module_dir = '', $lang = '')
 {
     if (empty($lang)) {
         $languages = array_keys($GLOBALS['sugar_config']['languages']);
     } else {
         $languages = array($lang);
     }
     //if we have a module name specified then just remove that language file
     //otherwise go through each module and clean up the language
     if (!empty($module_dir)) {
         foreach ($languages as $clean_lang) {
             LanguageManager::_clearCache($module_dir, $clean_lang);
         }
     } else {
         $cache_dir = sugar_cached('modules');
         if (file_exists($cache_dir)) {
             foreach (glob("{$cache_dir}/*", GLOB_ONLYDIR | GLOB_NOSORT) as $entry) {
                 $module = basename($entry);
                 foreach ($languages as $clean_lang) {
                     LanguageManager::_clearCache($module, $clean_lang);
                 }
             }
         }
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:31,代码来源:LanguageManager.php

示例2: clearLanguageCache

 /**
  * clear out the language cache.
  * @param string module_dir the module_dir to clear, if not specified then clear
  *                      clear language cache for all modules.
  * @param string lang the name of the object we are clearing this is for sugar_cache
  */
 function clearLanguageCache($module_dir = '', $lang = '')
 {
     if (empty($lang)) {
         $languages = array_keys($GLOBALS['sugar_config']['languages']);
     } else {
         $languages = array($lang);
     }
     //if we have a module name specified then just remove that language file
     //otherwise go through each module and clean up the language
     if (!empty($module_dir)) {
         foreach ($languages as $clean_lang) {
             LanguageManager::_clearCache($module_dir, $clean_lang);
         }
     } else {
         $cache_dir = sugar_cached('modules/');
         if (file_exists($cache_dir) && ($dir = @opendir($cache_dir))) {
             while (($entry = readdir($dir)) !== false) {
                 if ($entry == "." || $entry == "..") {
                     continue;
                 }
                 foreach ($languages as $clean_lang) {
                     LanguageManager::_clearCache($entry, $clean_lang);
                 }
             }
             closedir($dir);
         }
     }
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:34,代码来源:LanguageManager.php

示例3: clearLanguageCache

 /**
  * clear out the language cache. 
  * @param string module_dir the module_dir to clear, if not specified then clear
  *                      clear vardef cache for all modules.
  * @param string lang the name of the object we are clearing this is for sugar_cache
  */
 function clearLanguageCache($module_dir = '', $lang = '')
 {
     if (empty($lang)) {
         $lang = $GLOBALS['sugar_config']['default_language'];
     }
     //if we have a module name specified then just remove that vardef file
     //otherwise go through each module and remove the vardefs.php
     if (!empty($module_dir)) {
         LanguageManager::_clearCache($module_dir, $lang);
     } else {
         global $beanList;
         foreach ($beanList as $module_dir => $object_name) {
             LanguageManager::_clearCache($module_dir, $lang);
         }
     }
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:22,代码来源:LanguageManager.php


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