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