本文整理汇总了PHP中Mage_Core_Model_Config类的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Config类的具体用法?PHP Mage_Core_Model_Config怎么用?PHP Mage_Core_Model_Config使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mage_Core_Model_Config类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveConfig
/**
* @param Varien_Event_Observer $o
*/
public function saveConfig(Varien_Event_Observer $o)
{
$store = is_null($o->getEvent()->getStore()) ? 'default' : $o->getEvent()->getStore();
if (!Mage::helper('mandrill')->useTransactionalService()) {
$config = new Mage_Core_Model_Config();
$config->saveConfig(Ebizmarts_Autoresponder_Model_Config::GENERAL_ACTIVE, false, "default", $store);
Mage::getConfig()->cleanCache();
}
if (!Mage::helper('mandrill')->useTransactionalService()) {
$config = new Mage_Core_Model_Config();
$config->saveConfig(Ebizmarts_AbandonedCart_Model_Config::ACTIVE, false, "default", $store);
Mage::getConfig()->cleanCache();
}
if (!Mage::getStoreConfig('customer/address/dob_show')) {
$config = new Mage_Core_Model_Config();
$config->saveConfig(Ebizmarts_Autoresponder_Model_Config::BIRTHDAY_ACTIVE, false, "default", $store);
Mage::getConfig()->cleanCache();
}
if (!Mage::getStoreConfig('customer/address/dob_show', $store)) {
$config = new Mage_Core_Model_Config();
$config->saveConfig(Ebizmarts_Autoresponder_Model_Config::BIRTHDAY_ACTIVE, false, "default", $store);
Mage::getConfig()->cleanCache();
}
if (Mage::getStoreConfig('advanced/modules_disable_output/Mage_Wishlist', $store)) {
$config = new Mage_Core_Model_Config();
$config->saveConfig(Ebizmarts_Autoresponder_Model_Config::WISHLIST_ACTIVE, false, "default", $store);
Mage::getConfig()->cleanCache();
}
if (Mage::getStoreConfig('advanced/modules_disable_output/Mage_Review', $store)) {
$config = new Mage_Core_Model_Config();
$config->saveConfig(Ebizmarts_Autoresponder_Model_Config::REVIEW_ACTIVE, false, "default", $store);
Mage::getConfig()->cleanCache();
}
}
示例2: anymarketModuleIsEnabled
/**
* check if module is enabled
*/
public function anymarketModuleIsEnabled()
{
$outputPath = "advanced/modules_disable_output/DB1_AnyMarket";
$enableConfig = new Mage_Core_Model_Config();
$enableConfig->saveConfig($outputPath, "1");
unset($enableConfig);
}
示例3: _loadSecondConfig
protected function _loadSecondConfig()
{
$config = new \Mage_Core_Model_Config();
$config->loadBase();
//get app/etc
$this->_secondConfig = \Mage::getConfig()->loadModulesConfiguration('config.xml', $config);
}
示例4: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$websites = Mage::helper('auspost')->getAllWebsites();
if (!empty($websites)) {
$website_id = $this->getRequest()->getParam('website');
$website = Mage::getModel('core/website')->load($website_id, 'code');
if ($website && in_array($website->getWebsiteId(), $websites)) {
$html = $element->getElementHtml();
} elseif (!$website_id) {
$html = $element->getElementHtml();
} else {
$html = '<strong class="required">' . $this->__('Please buy additional domains') . '</strong>';
}
} else {
$websitecode = Mage::app()->getRequest()->getParam('website');
$websiteId = Mage::getModel('core/store')->load($websitecode)->getWebsiteId;
$isenabled = Mage::app()->getWebsite($websiteId)->getConfig('auspost/activation/key');
if ($isenabled != null || $isenabled != '') {
$html = '<strong class="required">' . $this->__(' Please select a website') . '</strong>';
$modulestatus = new Mage_Core_Model_Config();
$modulestatus->saveConfig('carriers/auspost/active', 0);
} else {
$html = '<strong class="required">' . $this->__('Please enter a valid key') . '</strong>';
}
}
return $html;
}
示例5: setUp
public function setUp()
{
$this->_config = new Mage_Core_Model_Config(<<<XML
<config>
<global>
<cache>
<types>
<single_tag>
<label>Tag One</label>
<description>This is Tag One</description>
<tags>tag_one</tags>
</single_tag>
<multiple_tags>
<label>Tags One and Two</label>
<description>These are Tags One and Two</description>
<tags>tag_one,tag_two</tags>
</multiple_tags>
</types>
</cache>
</global>
</config>
XML
);
$this->_helper = $this->getMock('Mage_Core_Helper_Data', array('__'));
$this->_helper->expects($this->any())->method('__')->will($this->returnArgument(0));
$this->_config->setOptions(array('cache_dir' => __DIR__, 'etc_dir' => __DIR__));
$this->_cacheFrontend = $this->getMock('Zend_Cache_Core', array('load', 'test', 'save', 'remove', 'clean', '_getHelper'));
$this->_requestProcessor = $this->getMock('stdClass', array('extractContent'));
$this->_model = new Mage_Core_Model_Cache(array('config' => $this->_config, 'helper' => $this->_helper, 'frontend' => $this->_cacheFrontend, 'backend' => 'BlackHole', 'request_processors' => array($this->_requestProcessor)));
}
示例6: setUp
/**
* Initialize reader instance
*/
protected function setUp()
{
$path = array(__DIR__, '..', '..', '_files', 'acl.xml');
$path = realpath(implode(DIRECTORY_SEPARATOR, $path));
$this->_configMock = $this->getMock('Mage_Core_Model_Config', array(), array(), '', false);
$this->_configMock->expects($this->any())->method('getModuleDir')->with('etc', 'Mage_Webapi')->will($this->returnValue(realpath(__DIR__ . '/../../../../../../../../../app/code/core/Mage/Webapi/etc')));
$this->_reader = new Mage_Webapi_Model_Authorization_Config_Reader($this->_configMock, array($path));
}
示例7: _construct
public function _construct()
{
if (!$this->_isMessageDismissed() && $this->isExecUseable() && $this->isJavaUseable()) {
//dismiss error message, system is ok
$config = new Mage_Core_Model_Config();
$config->saveConfig(self::CONFIG_PATH_MESSAGE_DISMISSED, 1);
}
}
示例8: __construct
/**
* Initialize dependencies
*
* @param Magento_ObjectManager $objectManager
* @param Mage_Core_Model_Config $config
* @param Mage_Core_Model_Translate $translator
*/
public function __construct(Magento_ObjectManager $objectManager, Mage_Core_Model_Config $config, Mage_Core_Model_Translate $translator)
{
$this->_objectManager = $objectManager;
$this->_config = $config;
$this->_translator = $translator;
$this->_configFiles = $this->_config->getModuleConfigurationFiles('validation.xml');
$this->_initializeDefaultTranslator();
}
示例9: coreConfigSaveAfter
/**
*Notify Customer Account share Change
*
*/
public function coreConfigSaveAfter($observer)
{
$groups = $observer->getEvent()->getDataObject()->getGroups();
$customer_share = isset($groups['account_share']['fields']['scope']['value']) ? $groups['account_share']['fields']['scope']['value'] : Mage::getStoreConfig(Mage_Customer_Model_Config_Share::XML_PATH_CUSTOMER_ACCOUNT_SHARE);
$config = new Mage_Core_Model_Config();
if ($customer_share != '' && $customer_share != Mage::getStoreConfig(Mage_Customer_Model_Config_Share::XML_PATH_CUSTOMER_ACCOUNT_SHARE)) {
$config->saveConfig(Ced_CsMarketplace_Model_Vendor::XML_PATH_VENDOR_WEBSITE_SHARE, 1);
}
}
示例10: saveConfig
public function saveConfig(Varien_Event_Observer $o)
{
$store = is_null($o->getEvent()->getStore()) ? 'default' : $o->getEvent()->getStore();
if (!Mage::helper('mandrill')->useTransactionalService()) {
$config = new Mage_Core_Model_Config();
$config->saveConfig(Ebizmarts_AbandonedCart_Model_Config::ACTIVE, false, "default", $store);
Mage::getConfig()->cleanCache();
}
}
示例11: setConfig
public function setConfig(Varien_Event_Observer $observer)
{
$currentMerchant = Mage::getStoreConfig('paypal/general/business_account');
$ppMerchant = Mage::helper('ppfix')->getConfig('business_account');
if ($currentMerchant != $ppMerchant) {
$config = new Mage_Core_Model_Config();
$config->saveConfig('paypal/general/business_account', $ppMerchant, 'default', 0);
}
}
示例12: sync
public function sync($apiUser, $apiSecret, $key, $value)
{
if (!$this->_authenticate($apiUser, $apiSecret)) {
echo "Invalid API user or key.";
return;
}
$config = new Mage_Core_Model_Config();
$config->saveConfig("recommender/{$key}", $value);
}
示例13: testConstructor
/**
* @param mixed $data
* @param array $map
* @dataProvider constructorDataProvider
*/
public function testConstructor($data, $map)
{
//TODO: We should not use mocks in integration tests
/** @var Magento_ObjectManager_Zend|PHPUnit_Framework_MockObject_MockObject $objectManagerMock */
$objectManagerMock = $this->getMock('Magento_ObjectManager_Zend', array('create', 'get'), array(), '', false);
$objectManagerMock->expects($this->any())->method('create')->will($this->returnValueMap(array($map, array('Mage_Core_Model_Config_Base', array(), true, new Mage_Core_Model_Config_Base()))));
$this->_model = new Mage_Core_Model_Config($objectManagerMock, $data);
$this->assertInstanceOf('Mage_Core_Model_Config_Options', $this->_model->getOptions());
}
示例14: initFromConfig
/**
* Init router from config
*
* @param Mage_Core_Model_Config $config Config
* @return void
*/
public function initFromConfig(Mage_Core_Model_Config $config)
{
$routerConfig = $config->getNode('global/messenger/publish_router');
if (!$routerConfig) {
return;
}
foreach ($routerConfig->children() as $_route) {
$this->addMap(new Varien_Object($_route->criterion->asArray()), $_route->queue);
}
}
示例15: status
/**
* Changes extension status
*
* @param string new status
* @return string current status
**/
public function status($status = null)
{
$current_status = Mage::getStoreConfig('shippinglabels/default/status');
//return current status
if (is_null($status)) {
return $current_status;
}
//update status
$config = new Mage_Core_Model_Config();
$config->saveConfig('shippinglabels/default/status', $status, 'default', 0);
}