本文整理汇总了PHP中Varien_Simplexml_Config::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Simplexml_Config::__construct方法的具体用法?PHP Varien_Simplexml_Config::__construct怎么用?PHP Varien_Simplexml_Config::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Simplexml_Config
的用法示例。
在下文中一共展示了Varien_Simplexml_Config::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*
* @see Varien_Simplexml_Config
*/
public function __construct($sourceData = null)
{
$this->setCacheId('config_api');
$this->setCacheTags(array(self::CACHE_TAG));
parent::__construct($sourceData);
$this->_construct();
}
示例2: __construct
/**
* Class constructor
*
* @param array $data
*/
public function __construct($data = array())
{
$this->_elementClass = Mage::getConfig()->getModelClassName('core/layout_element');
$this->setXml(simplexml_load_string('<layout/>', $this->_elementClass));
$this->_update = Mage::getModel('core/layout_update');
parent::__construct($data);
}
示例3: __construct
/**
* Load config from merged adminhtml.xml files
*/
public function __construct()
{
parent::__construct();
$this->setCacheId('adminhtml_acl_menu_config');
/* @var $adminhtmlConfig Varien_Simplexml_Config */
$adminhtmlConfig = Mage::app()->loadCache($this->getCacheId());
if ($adminhtmlConfig) {
$this->_adminhtmlConfig = new Varien_Simplexml_Config($adminhtmlConfig);
} else {
$adminhtmlConfig = new Varien_Simplexml_Config();
$adminhtmlConfig->loadString('<?xml version="1.0"?><config></config>');
Mage::getConfig()->loadModulesConfiguration('adminhtml.xml', $adminhtmlConfig);
$this->_adminhtmlConfig = $adminhtmlConfig;
/**
* @deprecated after 1.4.0.0-alpha2
* support backwards compatibility with config.xml
*/
$aclConfig = Mage::getConfig()->getNode('adminhtml/acl');
if ($aclConfig) {
$adminhtmlConfig->getNode()->extendChild($aclConfig, true);
}
$menuConfig = Mage::getConfig()->getNode('adminhtml/menu');
if ($menuConfig) {
$adminhtmlConfig->getNode()->extendChild($menuConfig, true);
}
if (Mage::app()->useCache('config')) {
Mage::app()->saveCache($adminhtmlConfig->getXmlString(), $this->getCacheId(), array(Mage_Core_Model_Config::CACHE_TAG));
}
}
}
示例4: __construct
public function __construct($data = null)
{
parent::__construct($data);
$cacheConfig = Mage::getConfig()->loadModulesConfiguration('cache.xml');
$customConfig = Mage::getConfig()->loadModulesConfiguration('custom.xml');
$cacheConfig->extend($customConfig);
$this->setXml($cacheConfig->getNode());
return $this;
}
示例5: __construct
public function __construct($sourceData = null)
{
$this->_elementClass = 'Mage_Api_Model_Wsdl_Config_Element';
// remove wsdl parameter from query
$queryParams = Mage::app()->getRequest()->getQuery();
unset($queryParams['wsdl']);
// set up default WSDL template variables
$this->_wsdlVariables = new Varien_Object(array('name' => 'Magento', 'url' => htmlspecialchars(Mage::getUrl('*/*/*', array('_query' => $queryParams)))));
parent::__construct($sourceData);
}
示例6: __construct
/**
* Constructor
* Initializes XML for this configuration
* Local cache configuration
*
* @param string|Varien_Simplexml_Element|null $sourceData
*/
public function __construct($sourceData = null)
{
parent::__construct($sourceData);
$canUserCache = Mage::app()->useCache('config');
if ($canUserCache) {
$this->setCacheId(self::CACHE_ID)->setCacheTags(array(self::CACHE_TAG))->setCacheChecksum(null)->setCache(Mage::app()->getCache());
if ($this->loadCache()) {
return;
}
}
// Load data of config files api2.xml
$config = Mage::getConfig()->loadModulesConfiguration('api2.xml');
$this->setXml($config->getNode('api2'));
if ($canUserCache) {
$this->saveCache();
}
}
示例7: __construct
/**
* Load cache on instantiation
*
* @param null|string|Varien_Simplexml_Element $sourceData
*/
public function __construct($sourceData = null)
{
$this->setCacheId(self::CACHE_KEY);
$this->setCacheTags(array(self::CACHE_TAG));
parent::__construct($sourceData);
if (Mage::app()->useCache(self::CACHE_KEY)) {
$this->setCache(Mage::app()->getCache());
if ($this->loadCache()) {
return;
}
}
$config = Mage::getConfig()->loadModulesConfiguration('mongo.xml');
$this->setXml($config->getNode());
if (Mage::app()->useCache(self::CACHE_KEY)) {
$this->saveCache();
}
}
示例8: __construct
/**
* Load config from merged adminhtml.xml files
*/
public function __construct()
{
parent::__construct();
$this->setCacheId('adminhtml_acl_menu_config');
/* @var $adminhtmlConfig Varien_Simplexml_Config */
$adminhtmlConfig = Mage::app()->loadCache($this->getCacheId());
if ($adminhtmlConfig) {
$this->_adminhtmlConfig = new Varien_Simplexml_Config($adminhtmlConfig);
} else {
$adminhtmlConfig = new Varien_Simplexml_Config();
$adminhtmlConfig->loadString('<?xml version="1.0"?><config></config>');
Mage::getConfig()->loadModulesConfiguration('adminhtml.xml', $adminhtmlConfig);
$this->_adminhtmlConfig = $adminhtmlConfig;
if (Mage::app()->useCache('config')) {
Mage::app()->saveCache($adminhtmlConfig->getXmlString(), $this->getCacheId(), array(Mage_Core_Model_Config::CACHE_TAG));
}
}
}
示例9: __construct
/**
* Class constructor
* load cache configuration
*
* @param $data
*/
public function __construct($data = null)
{
parent::__construct($data);
$this->setCacheId('cache_config');
$this->_cacheChecksum = null;
$this->_cache = Mage::app()->getCache();
$canUsaCache = Mage::app()->useCache('config');
if ($canUsaCache) {
if ($this->loadCache()) {
return $this;
}
}
$config = Mage::getConfig()->loadModulesConfiguration('cache.xml');
$this->setXml($config->getNode());
if ($canUsaCache) {
$this->saveCache(array(Mage_Core_Model_Config::CACHE_TAG));
}
return $this;
}
示例10: __construct
/**
* Load config from merged adminhtml.xml files
* @param array $arguments
*/
public function __construct(array $arguments = array())
{
$this->_app = isset($arguments['app']) ? $arguments['app'] : Mage::app();
$this->_appConfig = isset($arguments['appConfig']) ? $arguments['appConfig'] : Mage::getConfig();
if (isset($arguments['helpers'])) {
$this->_helpers = $arguments['helpers'];
}
parent::__construct();
$this->setCacheId('adminhtml_acl_menu_config');
/* @var $adminhtmlConfig Varien_Simplexml_Config */
$adminhtmlConfig = $this->_app->loadCache($this->getCacheId());
if ($adminhtmlConfig) {
$this->_adminhtmlConfig = new Varien_Simplexml_Config($adminhtmlConfig);
} else {
$adminhtmlConfig = new Varien_Simplexml_Config();
$adminhtmlConfig->loadString('<?xml version="1.0"?><config></config>');
$this->_appConfig->loadModulesConfiguration('adminhtml.xml', $adminhtmlConfig);
$this->_adminhtmlConfig = $adminhtmlConfig;
if ($this->_app->useCache('config')) {
$this->_app->saveCache($adminhtmlConfig->getXmlString(), $this->getCacheId(), array(Mage_Core_Model_Config::CACHE_TAG));
}
}
}
示例11: __construct
/**
* Initializes XML for this configuration
*
* @param array $arguments
*/
public function __construct(array $arguments = array())
{
$this->_app = isset($arguments['app']) ? $arguments['app'] : Mage::app();
$sourceData = isset($arguments['data']) ? $arguments['data'] : array();
return parent::__construct($sourceData);
}
示例12: __construct
public function __construct()
{
parent::__construct();
$this->loadString('<?xml version="1.0"?><config></config>');
Mage::getConfig()->loadModulesConfiguration('install.xml', $this);
}
示例13: __construct
/**
* Constructor
*
*/
public function __construct($sourceData = null)
{
$this->_elementClass = 'Mage_Core_Model_Config_Element';
parent::__construct($sourceData);
}
示例14: __construct
public function __construct()
{
parent::__construct();
#$this->_elementClass = 'Mage_Core_Model_Config_Element';
#$this->loadFile(Mage::getModuleDir('etc', 'Mage_Admin').DS.'admin.xml');
}
示例15: __construct
public function __construct()
{
parent::__construct();
$this->loadFile(AO::getConfig()->getModuleDir('etc', 'Mage_Install') . DS . 'install.xml');
}