當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。