当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Config_Xml类代码示例

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


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


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