• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Zend_Config_Xml类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Zend_Config_Xml的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Config_Xml类的具体用法?PHP Zend_Config_Xml怎么用?PHP Zend_Config_Xml使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Zend_Config_Xml类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _loadParams

 /**
  * Do detection of content type, and retrieve parameters from raw body if
  * present
  *
  * @return void
  */
 protected function _loadParams()
 {
     $request = $this->getRequest();
     $contentType = $request->getHeader('Content-Type');
     $rawBody = $request->getRawBody();
     if (!$rawBody) {
         return;
     }
     switch (true) {
         case strstr($contentType, 'application/json'):
             $this->setBodyParams(Zend_Json::decode($rawBody));
             break;
         case strstr($contentType, 'application/xml'):
             $config = new Zend_Config_Xml($rawBody);
             $this->setBodyParams($config->toArray());
             break;
         default:
             if ($request->isPut()) {
                 parse_str($rawBody, $params);
                 $this->setBodyParams($params);
             }
             break;
     }
     self::$_paramsLoaded = true;
 }
开发者ID:netconstructor,项目名称:Centurion,代码行数:31,代码来源:Params.php


示例2: __construct

 /**
  * 
  */
 public function __construct($object = null)
 {
     $this->_object = $object;
     if (file_exists('/var/www/html/MaisVenda/cron.php')) {
         $this->_documentRoot = '/var/www/html/MaisVenda';
     } else {
         $this->_documentRoot = str_replace("\\", "/", realpath('.'));
     }
     /**
      * Busca as configurações do ambiente PHP
      */
     $filenameConfig = $this->_documentRoot . "/job/Config.xml";
     if (file_exists($filenameConfig)) {
         $xml = file_get_contents($filenameConfig);
         $config = new Zend_Config_Xml($xml);
         $this->_config = $config->toArray();
     }
     if (!isset($this->_config['Config']['Path'])) {
         $this->_config['Config']['Path'] = $this->_documentRoot . '/job/data';
     }
     if (!isset($this->_config['Config']['OperationSystem'])) {
         $this->_config['Config']['OperationSystem'] = 'Linux';
     }
     if (!isset($this->_config['Config']['PathPhpExe'])) {
         $this->_config['Config']['PathPhpExe'] = 'php';
     }
     if (!isset($this->_config['Config']['PathPhpExe'])) {
         $this->_config['Config']['PathPhpIni'] = '/etc/php.ini';
     }
     $this->_path = $this->_config['Config']['Path'];
     $this->_path = str_replace('\\', '/', $this->_path) . '/';
     //$this->_clearFiles();
 }
开发者ID:rtsantos,项目名称:mais,代码行数:36,代码来源:Thread.php


示例3: load

 /**
  * Склеивает все файлы в единый конфиг, попутно задействуя кеш
  *
  * @param string $path Путь к папке с файлами
  * @param string $env APPLICATION_ENV
  * @return array
  */
 public static function load($path, $env)
 {
     $masterfiles = array();
     if (file_exists($path . 'application.xml')) {
         $handler = opendir($path);
         while (($file = readdir($handler)) !== false) {
             if (strtolower(pathinfo($file, PATHINFO_EXTENSION)) == 'xml') {
                 $masterfiles[] = $path . $file;
             }
         }
         sort($masterfiles);
         closedir($handler);
         $cache = self::getCache($masterfiles);
         $cacheid = md5($path);
         if ($cache->test($cacheid)) {
             return $cache->load($cacheid);
         } else {
             $config = new Zend_Config_Xml($path . 'application.xml', $env, array('allowModifications' => true));
             foreach ($masterfiles as $file) {
                 if ($file != 'application.xml') {
                     $config->merge(new Zend_Config_Xml($file, $env));
                 }
             }
             $config = $config->toArray();
             $cache->save($config, $cacheid);
             return $config;
         }
     }
     return false;
 }
开发者ID:ei-grad,项目名称:phorm,代码行数:37,代码来源:Config.php


示例4: __construct

 /**
  * @param String $rawXmlResponse The response that comes back directly from the AT SOAP service.
  * @param String $methodName Name of the SOAP method called.
  */
 public function __construct($rawXmlResponse, $methodName)
 {
     $resultKey = $methodName . 'Result';
     $xml = $rawXmlResponse->{$resultKey};
     $xmlParser = new Zend_Config_Xml($xml);
     $resultArray = $xmlParser->toArray();
     $this->exchangeArray($resultArray);
 }
开发者ID:grrr-amsterdam,项目名称:garp3,代码行数:12,代码来源:Response.php


示例5: getConfig

 public static function getConfig()
 {
     if (!self::$pluginConfig) {
         $xml = new \Zend_Config_Xml(self::getConfigFile());
         self::$pluginConfig = $xml->toArray();
     }
     return self::$pluginConfig;
 }
开发者ID:ascertain,项目名称:NGshop,代码行数:8,代码来源:Plugin.php


示例6: navbarMainMenu

 function navbarMainMenu()
 {
     $config = new Zend_Config_Xml(APPLICATION_PATH . '/modules/admin/configs/navbar.xml', 'main');
     $container = new Zend_Navigation();
     $container->setPages($config->toArray());
     $view = new Zend_View();
     echo $view->navigation($container)->menu()->setUlClass('nav navbar-nav')->setMaxDepth(0)->render();
 }
开发者ID:Alpha-Hydro,项目名称:alpha-hydro-antares,代码行数:8,代码来源:NavbarMainMenu.php


示例7: sidebarMenu

 function sidebarMenu()
 {
     $config = new Zend_Config_Xml(APPLICATION_PATH . '/modules/admin/configs/sidebar.xml', 'sidebar');
     $container = new Zend_Navigation();
     $container->setPages($config->toArray());
     $view = new Zend_View();
     echo $view->navigation($container)->menu()->setMaxDepth(1)->render();
 }
开发者ID:Alpha-Hydro,项目名称:alpha-hydro-antares,代码行数:8,代码来源:SidebarMenu.php


示例8: __construct

 public function __construct()
 {
     try {
         $config = new Zend_Config_Xml(SPHINX_VAR . DIRECTORY_SEPARATOR . "config.xml");
         $this->config = $config->toArray();
     } catch (Zend_Config_Exception $e) {
         $this->config = $this->defaults;
     }
 }
开发者ID:VadzimBelski-ScienceSoft,项目名称:pimcore-plugin-SphinxSearch,代码行数:9,代码来源:Plugin.php


示例9: country

 public function country($elementName = "countryId", $selectedValue)
 {
     $config = new Zend_Config_Xml(CONFIG_PATH . '/countries.xml', 'countries');
     $aCountries = array();
     foreach ($config->get('country') as $country) {
         $aCountries[$country->alpha2] = $country->name;
     }
     return $this->formSelect($elementName, $selectedValue, null, $aCountries);
 }
开发者ID:hukumonline,项目名称:admin,代码行数:9,代码来源:Country.php


示例10: formSelectCountries

 public function formSelectCountries($elementName = "countryId", $selectedValue)
 {
     $config = new Zend_Config_Xml(KUTU_ROOT_DIR . '/application/configs/countries.xml', 'countries');
     $aCountries = array();
     foreach ($config->get('country') as $country) {
         //echo $country->name." ($country->alpha2)<br>";
         $aCountries[$country->alpha2] = $country->name;
     }
     return $this->formSelect($elementName, $selectedValue, null, $aCountries);
 }
开发者ID:hukumonline,项目名称:idh,代码行数:10,代码来源:FormSelectCountries.php


示例11: _initNavigation

 protected function _initNavigation()
 {
     $this->bootstrap('view');
     $this->bootstrap('frontController');
     $this->bootstrap('acl');
     $config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');
     $resource = new Zend_Application_Resource_Navigation(array('pages' => $config->toArray()));
     $resource->setBootstrap($this);
     return $resource->init();
 }
开发者ID:marcelocaixeta,项目名称:zf1,代码行数:10,代码来源:Bootstrap.php


示例12: unsetClassmap

 public function unsetClassmap()
 {
     $classmapXml = PIMCORE_CONFIGURATION_DIRECTORY . '/classmap.xml';
     try {
         $conf = new Zend_Config_Xml($classmapXml);
         $classmap = $conf->toArray();
         unset($classmap['Object_BlogEntry']);
         $writer = new Zend_Config_Writer_Xml(array('config' => new Zend_Config($classmap), 'filename' => $classmapXml));
         $writer->write();
     } catch (Exception $e) {
     }
 }
开发者ID:weblizards-gmbh,项目名称:blog,代码行数:12,代码来源:Install.php


示例13: authenticate

 /**
  * (non-PHPdoc)
  *
  * @see Zend_Auth_Adapter_Interface::authenticate()
  */
 public function authenticate()
 {
     $users = new Zend_Config_Xml(APPLICATION_PATH . "/modules/utils/configs/auth.xml");
     foreach ($users->toArray() as $user) {
         if ($user['email'] == $this->user) {
             if ($user['password'] == sha1($this->password)) {
                 return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, (object) $user);
             } else {
                 return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, $user);
             }
         }
     }
     return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND, $user);
 }
开发者ID:Alpha-Hydro,项目名称:alpha-hydro-antares,代码行数:19,代码来源:Auth.php


示例14: navbarRightMenu

 function navbarRightMenu()
 {
     $config = new Zend_Config_Xml(APPLICATION_PATH . '/modules/admin/configs/navbar.xml', 'nav');
     $container = new Zend_Navigation();
     $container->setPages($config->toArray());
     /*$container->addPage(
       array(
           'label'      => Zend_Auth::getInstance()->getIdentity()->email,
           'title'      => 'Dashboard',
           'uri'     => '/admin/'
       ));*/
     $view = new Zend_View();
     echo $view->navigation($container)->menu()->setUlClass('dropdown-menu')->render();
 }
开发者ID:Alpha-Hydro,项目名称:alpha-hydro-antares,代码行数:14,代码来源:NavbarRightMenu.php


示例15: databaseDetails

 function databaseDetails()
 {
     switch ($this->whichShoppingCart()) {
         case 'prestashop':
             require_once $this->shoppingCartRoot() . '/config/settings.inc.php';
             return array('dbname' => _DB_NAME_, 'username' => _DB_USER_, 'password' => _DB_PASSWD_, 'product_table' => 'ps_product', 'product_sku_field' => 'reference', 'product_id_field' => 'id_product');
         case 'magento':
             $config = new \Zend_Config_Xml($this->shoppingCartRoot() . 'app/etc/local.xml');
             $dbConfig = $config->toArray();
             $dbinfo = $dbConfig['global']['resources']['default_setup']['connection'];
             $dbinfo = $dbinfo + array('product_table' => 'catalog_product_entity', 'product_sku_field' => 'sku', 'product_id_field' => 'entity_id');
             return $dbinfo;
         default:
             throw new \Exception('Unable to detect shopping cart');
     }
 }
开发者ID:vehiclefits,项目名称:admin,代码行数:16,代码来源:ShoppingCartAdapter.php


示例16: setUp

 /**
  * Prepares the environment before running a test
  * 
  */
 protected function setUp()
 {
     // read navigation config
     $this->_files = dirname(__FILE__) . '/_files/navigation';
     $config = new Zend_Config_Xml($this->_files . '/navigation.xml');
     // create nav structures
     $this->_nav1 = new Zym_Navigation($config->get('nav_test1'));
     $this->_nav2 = new Zym_Navigation($config->get('nav_test2'));
     // create view
     $view = new Zend_View();
     $view->addHelperPath('Zym/View/Helper', 'Zym_View_Helper');
     // create helper
     $this->_helper = new $this->_helperName();
     $this->_helper->setView($view);
     // set nav1 in helper as default
     $this->_helper->setNavigation($this->_nav1);
 }
开发者ID:BGCX262,项目名称:zym-svn-to-git,代码行数:21,代码来源:NavigationTestAbstract.php


示例17: testClassCreate

 /**
  * creates a class called "unittest" containing all Object_Class_Data Types currently available.
  * @return void
  * @depends testFieldCollectionCreate
  */
 public function testClassCreate()
 {
     $conf = new Zend_Config_Xml(TESTS_PATH . "/resources/objects/class-import.xml");
     $importData = $conf->toArray();
     $layout = Object_Class_Service::generateLayoutTreeFromArray($importData["layoutDefinitions"]);
     $class = Object_Class::create();
     $class->setName("unittest");
     $class->setUserOwner(1);
     $class->save();
     $id = $class->getId();
     $this->assertTrue($id > 0);
     $class = Object_Class::getById($id);
     $class->setLayoutDefinitions($layout);
     $class->setUserModification(1);
     $class->setModificationDate(time());
     $class->save();
 }
开发者ID:ngocanh,项目名称:pimcore,代码行数:22,代码来源:ClassTest.php


示例18: getWebsiteConfig

 /**
  * @static
  * @return mixed|Zend_Config
  */
 public static function getWebsiteConfig()
 {
     try {
         $config = Zend_Registry::get("pimcore_config_website");
     } catch (Exception $e) {
         $cacheKey = "website_config";
         if (!($config = Pimcore_Model_Cache::load($cacheKey))) {
             $websiteSettingFile = PIMCORE_CONFIGURATION_DIRECTORY . "/website.xml";
             $settingsArray = array();
             if (is_file($websiteSettingFile)) {
                 $rawConfig = new Zend_Config_Xml($websiteSettingFile);
                 $arrayData = $rawConfig->toArray();
                 foreach ($arrayData as $key => $value) {
                     $s = null;
                     if ($value["type"] == "document") {
                         $s = Document::getByPath($value["data"]);
                     } else {
                         if ($value["type"] == "asset") {
                             $s = Asset::getByPath($value["data"]);
                         } else {
                             if ($value["type"] == "object") {
                                 $s = Object_Abstract::getByPath($value["data"]);
                             } else {
                                 if ($value["type"] == "bool") {
                                     $s = (bool) $value["data"];
                                 } else {
                                     if ($value["type"] == "text") {
                                         $s = (string) $value["data"];
                                     }
                                 }
                             }
                         }
                     }
                     if ($s) {
                         $settingsArray[$key] = $s;
                     }
                 }
             }
             $config = new Zend_Config($settingsArray, true);
             Pimcore_Model_Cache::save($config, $cacheKey, array("websiteconfig", "system", "config"), null, 998);
         }
         self::setWebsiteConfig($config);
     }
     return $config;
 }
开发者ID:ngocanh,项目名称:pimcore,代码行数:49,代码来源:Config.php


示例19: _loadConfig

 private function _loadConfig()
 {
     $coreConfig = new Zend_Config_Xml($this->dir . 'configs/core.xml', 'core', true);
     if ($coreConfig->mode == 'staging') {
         $config = new Zend_Config_Xml($this->dir . 'configs/core.xml', $coreConfig->mode, true);
         $config->merge($coreConfig);
     } else {
         /*	załadowanie konfigiracji z cache'a	*/
         if (!($config = $this->_cache->load('config'))) {
             $config = new Zend_Config_Xml($this->dir . 'configs/core.xml', $coreConfig->mode, true);
             $config->merge($coreConfig);
             $this->_cache->save($config, 'config', array('config'));
         }
     }
     $this->_config = $config;
     $this->_config->serviceDir = substr(__FILE__, 0, strpos(__FILE__, 'core' . DIRECTORY_SEPARATOR . 'Bootstrap.php'));
     Zend_Registry::set('config', $this->_config);
 }
开发者ID:adammajchrzak,项目名称:silesiamaps,代码行数:18,代码来源:Bootstrap.php


示例20: _loadOptions

 /**
  * Load the config file
  *
  * @param string $fullpath
  * @return array
  */
 protected function _loadOptions($fullpath)
 {
     if (file_exists($fullpath)) {
         switch (substr(trim(strtolower($fullpath)), -3)) {
             case 'ini':
                 $cfg = new Zend_Config_Ini($fullpath, $this->getBootstrap()->getEnvironment());
                 break;
             case 'xml':
                 $cfg = new Zend_Config_Xml($fullpath, $this->getBootstrap()->getEnvironment());
                 break;
             default:
                 throw new Zend_Config_Exception('Invalid format for config file');
                 break;
         }
     } else {
         throw new Zend_Application_Resource_Exception('File does not exist');
     }
     return $cfg->toArray();
 }
开发者ID:psykomo,项目名称:kutump,代码行数:25,代码来源:Modulesetup.php



注:本文中的Zend_Config_Xml类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Zend_Console_Getopt类代码示例发布时间:2022-05-23
下一篇:
PHP Zend_Config_Writer_Xml类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap