本文整理汇总了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;
}
示例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;
}
示例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];
}