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


PHP Varien_Simplexml_Element::extend方法代码示例

本文整理汇总了PHP中Varien_Simplexml_Element::extend方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Simplexml_Element::extend方法的具体用法?PHP Varien_Simplexml_Element::extend怎么用?PHP Varien_Simplexml_Element::extend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Varien_Simplexml_Element的用法示例。


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

示例1: getWidgetConfig

 /**
  * Load widget XML config and merge with theme widget config
  *
  * @return Varien_Simplexml_Element|null
  */
 public function getWidgetConfig()
 {
     if ($this->_widgetConfigXml === null) {
         $this->_widgetConfigXml = Mage::getSingleton('widget/widget')->getXmlElementByType($this->getType());
         if ($this->_widgetConfigXml) {
             $configFile = Mage::getSingleton('core/design_package')->getBaseDir(array('_area' => $this->getArea(), '_package' => $this->getPackage(), '_theme' => $this->getTheme(), '_type' => 'etc')) . DS . 'widget.xml';
             if (is_readable($configFile)) {
                 $themeWidgetsConfig = new Varien_Simplexml_Config();
                 $themeWidgetsConfig->loadFile($configFile);
                 if ($themeWidgetTypeConfig = $themeWidgetsConfig->getNode($this->_widgetConfigXml->getName())) {
                     $this->_widgetConfigXml->extend($themeWidgetTypeConfig);
                 }
             }
         }
     }
     return $this->_widgetConfigXml;
 }
开发者ID:jpbender,项目名称:mage_virtual,代码行数:22,代码来源:Instance.php

示例2: getWidgetConfig

 /**
  * Load widget XML config and merge with theme widget config
  *
  * @return Varien_Simplexml_Element|null
  */
 public function getWidgetConfig()
 {
     if ($this->_widgetConfigXml === null) {
         $this->_widgetConfigXml = Mage::getSingleton('Mage_Widget_Model_Widget')->getXmlElementByType($this->getType());
         if ($this->_widgetConfigXml) {
             $configFile = Mage::getDesign()->getFilename('widget.xml', array('_area' => $this->getArea(), '_package' => $this->getPackage(), '_theme' => $this->getTheme(), '_module' => Mage::getConfig()->determineOmittedNamespace(preg_replace('/^(.+?)\\/.+$/', '\\1', $this->getType()), true)));
             if (is_readable($configFile)) {
                 $themeWidgetsConfig = new Varien_Simplexml_Config();
                 $themeWidgetsConfig->loadFile($configFile);
                 if ($themeWidgetTypeConfig = $themeWidgetsConfig->getNode($this->_widgetConfigXml->getName())) {
                     $this->_widgetConfigXml->extend($themeWidgetTypeConfig);
                 }
             }
         }
     }
     return $this->_widgetConfigXml;
 }
开发者ID:relue,项目名称:magento2,代码行数:22,代码来源:Instance.php

示例3: _readLocalXml

 /**
  * Load application local.xml file, determine database vendor name
  *
  * @throws Magento_Exception
  */
 protected function _readLocalXml()
 {
     if (!is_file($this->_localXmlFile)) {
         throw new Magento_Exception("Local XML configuration file '{$this->_localXmlFile}' does not exist.");
     }
     // Read local.xml and merge customization file into it
     $this->_localXml = simplexml_load_string(file_get_contents($this->_localXmlFile), 'Varien_Simplexml_Element');
     if ($this->_customXmlFile) {
         $additionalOptions = simplexml_load_string(file_get_contents($this->_customXmlFile), 'Varien_Simplexml_Element');
         $this->_localXml->extend($additionalOptions);
     }
     // Extract db vendor
     $dbVendorId = (string) $this->_localXml->global->resources->default_setup->connection->model;
     $dbVendorMap = array('mysql4' => 'mysql', 'mssql' => 'mssql', 'oracle' => 'oracle');
     if (!array_key_exists($dbVendorId, $dbVendorMap)) {
         throw new Magento_Exception("Database vendor '{$dbVendorId}' is not supported.");
     }
     $this->_dbVendorName = $dbVendorMap[$dbVendorId];
 }
开发者ID:natxetee,项目名称:magento2,代码行数:24,代码来源:Bootstrap.php


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