public function __construct($sourceData = null) { $this->setCacheId('config_urapidflow'); $this->setCacheTags(array(self::CACHE_TAG)); $this->setCacheChecksum(null); parent::__construct($sourceData); $this->_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)); }
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')); }
/** * 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); } } }
/** * 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(); } }
/** * Constructor * * @param Mage_Core_Model_Config_Base $modulesConfig Modules configuration merged from the config files * @param array $allowedModules When not empty, defines modules to be taken into account */ public function __construct(Mage_Core_Model_Config_Base $modulesConfig, array $allowedModules = array()) { // initialize empty modules configuration parent::__construct('<config><modules/></config>'); $moduleDependencies = $this->_loadModuleDependencies($modulesConfig, $allowedModules); $this->_checkModuleRequirements($moduleDependencies); $moduleDependencies = $this->_sortModuleDependencies($moduleDependencies); // create sorted configuration foreach ($modulesConfig->getNode()->children() as $nodeName => $node) { if ($nodeName != 'modules') { $this->getNode()->appendChild($node); } } foreach ($moduleDependencies as $moduleInfo) { $node = $modulesConfig->getNode('modules/' . $moduleInfo['module']); $this->getNode('modules')->appendChild($node); } }
function __construct($sourceData = null) { parent::__construct($sourceData); }
/** * Constructor */ public function __construct() { parent::__construct(Mage::getConfig()->getNode('global/sales/order')); }
/** * Class construct * * @param mixed $sourceData */ public function __construct($sourceData = null) { $this->setCacheId('config_global'); parent::__construct($sourceData); }
/** * 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); }
public function __construct() { parent::__construct(Mage::getConfig()->getNode('global/customer/address')); }
public function __construct($sourceData = null) { parent::__construct($sourceData = null); $this->_magento2config = new Mage_Core_Model_Config_Base(); }
public function __construct() { parent::__construct(AO::getConfig()->getNode('global/sales/order_creditmemo')); }
/** * 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); }
public function __construct() { parent::__construct(AO::getConfig()->getNode('global')); }
/** * Define node * */ public function __construct() { parent::__construct(Mage::getConfig()->getNode()->global->customer->address); }
/** * 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); }
public function __construct() { parent::__construct(AO::getConfig()->getNode('global/sales/order_invoice')); }