當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Properties::loadProperties方法代碼示例

本文整理匯總了PHP中Properties::loadProperties方法的典型用法代碼示例。如果您正苦於以下問題:PHP Properties::loadProperties方法的具體用法?PHP Properties::loadProperties怎麽用?PHP Properties::loadProperties使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Properties的用法示例。


在下文中一共展示了Properties::loadProperties方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: doAction


//.........這裏部分代碼省略.........
             continue;
         }
         foreach ($customerConfig->globalLanguagePacks->globalLanguagePack as $globalLanguagePack) {
             if (empty($globalLanguagePack['name'])) {
                 continue;
             }
             $arrGlobalLanguagePacks[] = $globalLanguagePack;
             $globalLanguagePackPath = $globalLanguagePack['path'];
             if (empty($globalLanguagePackPath)) {
                 $globalLanguagePackPath = "";
             }
             if (!file_exists(DISK_ROOT . $globalLanguagePackPath)) {
                 throw new DirLoadException(DISK_ROOT . $globalLanguagePackPath);
             }
             $arrLanguagePacks = Util::traversalDir(DISK_ROOT . $globalLanguagePackPath);
             $languageFileExit = false;
             foreach ($arrLanguagePacks as $languagePack) {
                 $languagePackName = $languagePack;
                 if (Util::strStartWith($languagePack, trim($globalLanguagePack['name'])) && Util::strEndWith($languagePack, '.lgp')) {
                     $languageFileExit = true;
                     $languagePack = substr($languagePack, 0, -4);
                     $languageLeval = 'global_';
                     $languageSort = '';
                     $languageCountry = '';
                     $arrTemp = explode('_', $languagePack);
                     if (count($arrTemp) == 2) {
                         $languageSort = $arrTemp[1];
                     } elseif (count($arrTemp) == 3) {
                         $languageSort = $arrTemp[1];
                         $languageCountry = $arrTemp[2];
                     } else {
                     }
                     $languageProperties = new Properties(DISK_ROOT . $globalLanguagePackPath . '/' . $languagePackName);
                     $arrLanguageData = $languageProperties->loadProperties();
                     if (!empty($languageSort)) {
                         $langFlag = $languageLeval . $languageSort;
                         if (!empty($languageCountry)) {
                             $langFlag .= '_' . $languageCountry;
                         } else {
                         }
                     } else {
                         $langFlag = $languageLeval;
                     }
                     $objAction->addLanguagePack(array($langFlag => $arrLanguageData));
                 }
             }
             if (!$languageFileExit) {
                 throw new FileLoadException(DISK_ROOT . $globalLanguagePackPath . $globalLanguagePack['name'] . '.lgp');
             }
         }
     }
     //載入分級別的國際化信息 分為兩類 :類級別,包級別
     $arrLanguagePacks = Util::traversalDir($languagePacksPath);
     foreach ($arrLanguagePacks as $languagePack) {
         $languagePackName = $languagePack;
         if (Util::strEndWith($languagePack, '.lgp')) {
             $languagePack = substr($languagePack, 0, -4);
             $languageLeval = '';
             $languageSort = '';
             $languageCountry = '';
             if (Util::strStartWith($languagePack, $className)) {
                 $languageLeval = 'class_';
                 $arrTemp = explode('_', $languagePack);
                 if (count($arrTemp) == 2) {
                     $languageSort = $arrTemp[1];
                 } elseif (count($arrTemp) == 3) {
開發者ID:lincong1987,項目名稱:lanbowang,代碼行數:67,代碼來源:CoreEngine.php

示例2: Properties

<?php

require_once 'Util.php';
require_once 'Properties.php';
$configProperties = new Properties(realpath('.') . '/config/project.cfg');
$arrConfigDatas = $configProperties->loadProperties();
foreach ($arrConfigDatas as $paramName => $configData) {
    $paramName = strtoupper(trim($paramName));
    $configData = trim($configData);
    define($paramName, $configData);
}
開發者ID:lincong1987,項目名稱:lanbowang,代碼行數:11,代碼來源:config.php


注:本文中的Properties::loadProperties方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。