本文整理匯總了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) {
示例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);
}