當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。