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


PHP ConfService::listAvailableLanguages方法代码示例

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


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

示例1: init

 function init($confFile)
 {
     include_once $confFile;
     // INIT AS GLOBAL
     global $G_LANGUE, $G_AVAILABLE_LANG, $G_REPOSITORIES, $G_REPOSITORY, $G_USE_HTTPS, $G_WM_EMAIL, $G_MAX_CHAR, $G_UPLOAD_MAX_NUMBER, $G_UPLOAD_MAX_FILE, $G_UPLOAD_MAX_TOTAL, $G_UPLOAD_ENABLE_FLASH, $G_DEFAULT_REPOSITORIES, $G_AUTH_DRIVER_DEF, $G_CONF_PLUGINNAME, $G_PROBE_REAL_SIZE;
     if (!isset($langue) || $langue == "") {
         $langue = $default_language;
     }
     $G_LANGUE = $langue;
     if (isset($available_languages)) {
         $G_AVAILABLE_LANG = $available_languages;
     } else {
         $G_AVAILABLE_LANG = ConfService::listAvailableLanguages();
     }
     $G_USE_HTTPS = $use_https;
     $G_WM_EMAIL = $webmaster_email;
     $G_MAX_CHAR = $max_caracteres;
     $G_UPLOAD_MAX_NUMBER = $upload_max_number;
     $G_UPLOAD_ENABLE_FLASH = $upload_enable_flash;
     $G_UPLOAD_MAX_FILE = Utils::convertBytes($upload_max_size_per_file);
     $G_UPLOAD_MAX_TOTAL = Utils::convertBytes($upload_max_size_total);
     $G_DEFAULT_REPOSITORIES = $REPOSITORIES;
     $G_AUTH_DRIVER_DEF = $AUTH_DRIVER;
     $G_CONF_PLUGINNAME = $CONF_STORAGE["NAME"];
     $G_PROBE_REAL_SIZE = $allowRealSizeProbing;
     ConfService::initConfStorageImpl($CONF_STORAGE["NAME"], $CONF_STORAGE["OPTIONS"]);
     $G_REPOSITORIES = ConfService::initRepositoriesList($G_DEFAULT_REPOSITORIES);
     ConfService::switchRootDir();
 }
开发者ID:skdong,项目名称:nfs-ovd,代码行数:29,代码来源:class.ConfService.php

示例2: updateI18nFiles

 function updateI18nFiles()
 {
     include INSTALL_PATH . "/" . CLIENT_RESOURCES_FOLDER . "/i18n/en.php";
     $reference = $mess;
     $languages = ConfService::listAvailableLanguages();
     foreach ($languages as $key => $value) {
         $filename = INSTALL_PATH . "/" . CLIENT_RESOURCES_FOLDER . "/i18n/" . $key . ".php";
         include $filename;
         $missing = array();
         foreach ($reference as $messKey => $message) {
             if (!array_key_exists($messKey, $mess)) {
                 $missing[] = "\"{$messKey}\" => \"{$message}\",";
             }
         }
         //print_r($missing);
         if (count($missing)) {
             $header = array();
             $currentMessages = array();
             $footer = array();
             $fileLines = file($filename);
             foreach ($fileLines as $line) {
                 if (strstr($line, "\"") !== false) {
                     $currentMessages[] = trim($line);
                 } else {
                     if (!count($currentMessages)) {
                         $header[] = trim($line);
                     } else {
                         $footer[] = trim($line);
                     }
                 }
             }
             $currentMessages = array_merge($header, $currentMessages, $missing, $footer);
             file_put_contents($filename, join("\n", $currentMessages));
         }
     }
 }
开发者ID:skdong,项目名称:nfs-ovd,代码行数:36,代码来源:class.Utils.php

示例3: updateI18nFiles

 /**
  * Patch the languages files of an i18n library with the references strings from the "en" file.
  * @static
  * @param $baseDir
  * @param bool $detectLanguages
  * @param string $createLanguage
  */
 public static function updateI18nFiles($baseDir, $detectLanguages = true, $createLanguage = "")
 {
     if (!is_dir($baseDir) || !is_file($baseDir . "/en.php")) {
         return;
     }
     if ($createLanguage != "" && !is_file($baseDir . "/{$createLanguage}.php")) {
         @copy(AJXP_INSTALL_PATH . "/plugins/core.ajaxplorer/i18n-template.php", $baseDir . "/{$createLanguage}.php");
     }
     if (!$detectLanguages) {
         $languages = ConfService::listAvailableLanguages();
         $filenames = array();
         foreach ($languages as $key => $value) {
             $filenames[] = $baseDir . "/" . $key . ".php";
         }
     } else {
         $filenames = glob($baseDir . "/*.php");
     }
     $mess = array();
     include $baseDir . "/en.php";
     $reference = $mess;
     foreach ($filenames as $filename) {
         self::updateI18nFromRef($filename, $reference);
     }
 }
开发者ID:rbrdevs,项目名称:pydio-core,代码行数:31,代码来源:class.AJXP_Utils.php


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