本文整理汇总了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);
}