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


PHP ET::language_filename方法代码示例

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


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

示例1: loadLanguage

 /**
  * Load a language and its definition files, depending on what plugins are enabled.
  *
  * @param string $language The name of the language.
  * @return void
  */
 public static function loadLanguage($language = "")
 {
     if (isset(ET::$languageInfo[$language])) {
         return;
     }
     $narr = ET::$cache->filenames;
     if ($narr !== false && isset($narr["language_filename"])) {
         self::$language_filename = $narr["language_filename"];
     }
     //while $narr is empty create an new array
     if (empty($narr)) {
         $narr = array();
     }
     // Clear the currently loaded definitions.
     self::$definitions = array();
     // If the specified language doesn't exist, use the default language.
     self::$language = file_exists(PATH_LANGUAGES . "/" . sanitizeFileName($language) . "/definitions.php") ? $language : C("esoTalk.language");
     // Load the main definitions file.
     $languagePath = PATH_LANGUAGES . "/" . sanitizeFileName(self::$language);
     self::loadDefinitions("{$languagePath}/definitions.php");
     // Set the locale.
     if (isset(ET::$languageInfo[self::$language]["locale"])) {
         setlocale(LC_ALL, ET::$languageInfo[self::$language]["locale"]);
     }
     // Loop through the loaded plugins and include their definition files, if they exist.
     foreach (C("esoTalk.enabledPlugins") as $plugin) {
         if (empty(self::$language_filename) || self::$language_filename[$plugin] == false) {
             if (file_exists($file = "{$languagePath}/definitions." . sanitizeFileName($plugin) . ".php")) {
                 self::loadDefinitions($file);
                 self::$language_filename[$plugin] = $file;
                 $narr["language_filename"] = self::$language_filename;
                 //ET::$cache->store("language_filename" , self::$language_filename);
                 //ET::$cache->store(ET::$cache->fname_key , $narr);
                 ET::$cache->filenames = $narr;
                 ET::$cache->fnamechanged = true;
             }
         } else {
             $file = self::$language_filename[$plugin];
             self::loadDefinitions($file);
         }
     }
     //var_dump($narr);//exit();
     unset($narr);
     // Re-define runtime definitions.
     foreach (self::$runtimeDefinitions as $k => $v) {
         ET::define($k, $v);
     }
 }
开发者ID:ky0ncheng,项目名称:esotalk-for-sae,代码行数:54,代码来源:ET.class.php


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