本文整理汇总了PHP中Mage_Core_Model_Config_Base::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Config_Base::__construct方法的具体用法?PHP Mage_Core_Model_Config_Base::__construct怎么用?PHP Mage_Core_Model_Config_Base::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Config_Base
的用法示例。
在下文中一共展示了Mage_Core_Model_Config_Base::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($sourceData = null)
{
$this->setCacheId('config_urapidflow');
$this->setCacheTags(array(self::CACHE_TAG));
$this->setCacheChecksum(null);
parent::__construct($sourceData);
$this->_construct();
}
示例2: __construct
public function __construct($arg)
{
list($sourceData, $moduleName) = $arg;
parent::__construct($sourceData);
$this->_config = Mage::getConfig();
$this->_moduleName = $moduleName;
$this->_moduleDir = realpath(Mage::getModuleDir('', $moduleName));
$this->_etcModuleDir = realpath(Mage::getModuleDir('etc', $moduleName));
}
示例3: __construct
public function __construct()
{
error_reporting(E_ALL & ~E_NOTICE);
// We have no interest in supporting notice based errors. Just turn them off.
// grab the nodes with the connection information
$foreignNode = Mage::getConfig()->getNode('global/resources/pap_foreign/connection');
// grab the connection information from the store config
$host = Mage::getStoreConfig('pap_config/connection/host');
$username = Mage::getStoreConfig('pap_config/connection/username');
$password = Mage::getStoreConfig('pap_config/connection/password');
$dbname = Mage::getStoreConfig('pap_config/connection/dbname');
// also get API information
$this->apiusername = Mage::getStoreConfig('pap_config/api/username');
$this->apipassword = Mage::getStoreConfig('pap_config/api/password');
// update the configuration information in memory from the store configuration
// We have to do this so that when things attempt to connect to a database,
// the right database can be found and connected to
$foreignNode->setNode('host', $host);
$foreignNode->setNode('username', $username);
$foreignNode->setNode('password', $password);
$foreignNode->setNode('dbname', $dbname);
// remember whether we have enough information to connect
$this->dbconfigured = $host && $username && $password && $dbname;
$this->configured = $this->apiusername && $this->apipassword;
if ($this->dbconfigured && !$this->configured) {
// we have the old DB information, but not the new password information.
// The module was rewritten to use the API (which requires a PAP username
// and password, rather than database access.)
// Try to get an admin password from the DB.
$foreignConnection = Mage::getSingleton('core/resource')->getConnection('pap_foreign');
try {
if ($mercaccount = $foreignConnection->fetchRow("SELECT au.username AS username, au.rpassword AS password FROM qu_g_authusers AS au INNER JOIN qu_g_users AS u ON au.authid = u.authid WHERE u.roleid = 'pap_merc'")) {
// we found the first merchant account. remember the username and password.
$this->apiusername = $mercaccount['username'];
$this->apipassword = $mercaccount['password'];
// recalculate the "configured" value.
$this->configured = $this->apiusername && $this->apipassword;
// save off the username and password so we don't have to recalculate again.
Mage::getConfig()->saveConfig('pap_config/api/username', $this->apiusername);
Mage::getConfig()->saveConfig('pap_config/api/password', $this->apipassword);
}
} catch (Exception $e) {
// Something bad happened. I guess we won't be able to update this automatically.
}
}
parent::__construct(Mage::getConfig()->getNode('global'));
}
示例4: array
/**
* Constructor
*
* Loading of custom configuration files
* from different modules
*
* @param string $sourceData
*/
function __construct($sourceData = null)
{
$tags = array(self::CACHE_TAG);
$useCache = Mage::app()->useCache(self::CACHE_TAG);
$this->setCacheId(self::CACHE_KEY);
$this->setCacheTags($tags);
if ($useCache && ($cache = Mage::app()->loadCache(self::CACHE_KEY))) {
parent::__construct($cache);
} else {
parent::__construct(self::CONFIG_TEMPLATE);
Mage::getConfig()->loadModulesConfiguration(self::CONFIG_FILENAME, $this);
if ($useCache) {
$xmlString = $this->getXmlString();
Mage::app()->saveCache($xmlString, self::CACHE_KEY, $tags);
}
}
}
示例5: __construct
/**
* Constructor.
* Load configuration from enabled modules with appropriate caching.
*
* @param Varien_Simplexml_Element|string|null $data
*/
public function __construct($data = null)
{
parent::__construct($data);
$canUseCache = Mage::app()->useCache('config');
if ($canUseCache) {
/* Setup caching with no checksum validation */
$this->setCache(Mage::app()->getCache())->setCacheChecksum(null)->setCacheId('fieldset_config')->setCacheTags(array(Mage_Core_Model_Config::CACHE_TAG));
if ($this->loadCache()) {
return;
}
}
$config = Mage::getConfig()->loadModulesConfiguration('fieldset.xml');
$this->setXml($config->getNode());
if ($canUseCache) {
$this->saveCache();
}
}
示例6:
function __construct($sourceData = null)
{
parent::__construct($sourceData);
}
示例7: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct(Mage::getConfig()->getNode('global/sales/order'));
}
示例8: __construct
/**
* Class construct
*
* @param mixed $sourceData
*/
public function __construct($sourceData = null)
{
$this->setCacheId('config_global');
parent::__construct($sourceData);
}
示例9: __construct
/**
* Class construct
*
* @param Magento_ObjectManager $objectManager
* @param mixed $sourceData
*/
public function __construct(Magento_ObjectManager $objectManager, $sourceData = null)
{
$this->_objectManager = $objectManager;
$this->setCacheId('config_global');
$options = $sourceData;
if (!is_array($options)) {
$options = array($options);
}
$this->_options = $this->_objectManager->create('Mage_Core_Model_Config_Options', array('data' => $options));
$this->_prototype = $this->_objectManager->create('Mage_Core_Model_Config_Base');
$this->_prototype->loadString('<config/>');
$this->_cacheChecksum = null;
parent::__construct($sourceData);
}
示例10: __construct
public function __construct()
{
parent::__construct(Mage::getConfig()->getNode('global/customer/address'));
}
示例11: __construct
public function __construct($sourceData = null)
{
parent::__construct($sourceData = null);
$this->_magento2config = new Mage_Core_Model_Config_Base();
}
示例12: __construct
public function __construct()
{
parent::__construct(AO::getConfig()->getNode('global/sales/order_creditmemo'));
}
示例13: __construct
/**
* Class construct
*
* @param mixed $sourceData
*/
public function __construct($sourceData = null)
{
$this->setCacheId('config_global');
$this->_options = new Mage_Core_Model_Config_Options();
parent::__construct($sourceData);
}
示例14: __construct
/**
* Define node
*
*/
public function __construct()
{
parent::__construct(Mage::getConfig()->getNode()->global->customer->address);
}
示例15: __construct
/**
* Class construct
*
* @param mixed $sourceData
*/
public function __construct($sourceData = null)
{
$this->setCacheId('config_global');
$this->_options = new Mage_Core_Model_Config_Options($sourceData);
$this->_prototype = new Mage_Core_Model_Config_Base();
$this->_cacheChecksum = null;
parent::__construct($sourceData);
}