当前位置: 首页>>代码示例>>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;未经允许,请勿转载。