当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Core_Model_Config::deleteConfig方法代码示例

本文整理汇总了PHP中Mage_Core_Model_Config::deleteConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Config::deleteConfig方法的具体用法?PHP Mage_Core_Model_Config::deleteConfig怎么用?PHP Mage_Core_Model_Config::deleteConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Core_Model_Config的用法示例。


在下文中一共展示了Mage_Core_Model_Config::deleteConfig方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

<?php

/**
 * Created by PhpStorm.
 * User: Vlad-Home
 * Date: 2/14/2016
 * Time: 1:44 PM
 */
$installer = $this;
$installer->startSetup();
$setup = new Mage_Core_Model_Config();
foreach (unserialize(Mage::getStoreConfig('gluu/oxd/oxd_openid_custom_scripts')) as $custom_script) {
    $setup->deleteConfig('GluuOxd/Openid/' . $custom_script['value'] . 'Enable');
}
$setup->deleteConfig('gluu/oxd/oxd_id');
$setup->deleteConfig('gluu/oxd/oxd_openid_scops');
$setup->deleteConfig('gluu/oxd/oxd_config');
$setup->deleteConfig('gluu/oxd/oxd_openid_scops');
$setup->deleteConfig('gluu/oxd/oxd_openid_custom_scripts');
$setup->deleteConfig('GluuOxd/Openid/loginTheme');
$setup->deleteConfig('GluuOxd/Openid/loginCustomTheme');
$setup->deleteConfig('GluuOxd/Openid/iconSpace');
$setup->deleteConfig('GluuOxd/Openid/iconCustomSize');
$setup->deleteConfig('GluuOxd/Openid/iconCustomWidth');
$setup->deleteConfig('GluuOxd/Openid/iconCustomHeight');
$setup->deleteConfig('GluuOxd/Openid/iconCustomColor');
$installer->endSetup();
开发者ID:GluuFederation,项目名称:gluu-magento-sso-login-extension,代码行数:27,代码来源:mysql4-upgrade-1.9.2-1.9.3.php

示例2: _updateConfigStoreScope

 protected function _updateConfigStoreScope(Mage_Core_Model_Config $config, $scope, $scopeId, $settings, $defaults)
 {
     foreach ($settings as $path => $value) {
         // Only save if in default scope or value is different from default scope
         if ('default' === $scope || $value !== $defaults[$path]) {
             $config->saveConfig($path, $value, $scope, $scopeId);
         } else {
             $config->deleteConfig($path, $scope, $scopeId);
         }
     }
     // Delete store scope settings so the default scope value will take effect
     if ('default' !== $scope) {
         $config->deleteConfig('netzarbeiter_groupscatalog2/general/product_mode', $scope, $scopeId);
         $config->deleteConfig('netzarbeiter_groupscatalog2/general/category_mode', $scope, $scopeId);
         $config->deleteConfig('netzarbeiter_groupscatalog2/general/product_default_show', $scope, $scopeId);
         $config->deleteConfig('netzarbeiter_groupscatalog2/general/category_default_show', $scope, $scopeId);
     }
 }
开发者ID:gewaechshaus,项目名称:groupscatalog2,代码行数:18,代码来源:Migration.php

示例3:

 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * In version 2.0 we are replacing the deprecated Feedback Tab with the new
 * Embeddables Web Widget.
 * More info: https://www.zendesk.com/embeddables
 *
 * In this data upgrade we are going to drop the Feedback Tab related settings
 * from the database, and inserting the required fields for the Web Widget.
 */
$config = new Mage_Core_Model_Config();
// We won't need the Feedback Tab code snippet anymore
$config->deleteConfig('zendesk/frontend_features/feedback_tab_code');
// We won't check in our code whether to show or not the Feedback Tab
$config->deleteConfig('zendesk/frontend_features/feedback_tab_code_active');
// Retrieve the domain from the config settings
$domain = Mage::getStoreConfig('zendesk/general/domain');
if ($domain) {
    // We are activating the Web Widget by default
    $config->saveConfig('zendesk/frontend_features/web_widget_code_active', 1);
    // The Web Widget code snippet, using the account zendesk domain from settings
    $webWidgetSnippet = <<<EOJS
<!-- Start of Zendesk Widget script -->
<script>/*<![CDATA[*/window.zEmbed||function(e,t){var n,o,d,i,s,a=[],r=document.createElement("iframe");window.zEmbed=function(){a.push(arguments)},window.zE=window.zE||window.zEmbed,r.src="javascript:false",r.title="",r.role="presentation",(r.frameElement||r).style.cssText="display: none",d=document.getElementsByTagName("script"),d=d[d.length-1],d.parentNode.insertBefore(r,d),i=r.contentWindow,s=i.document;try{o=s}catch(c){n=document.domain,r.src='javascript:var d=document.open();d.domain="'+n+'";void(0);',o=s}o.open()._l=function(){var o=this.createElement("script");n&&(this.domain=n),o.id="js-iframe-async",o.src=e,this.t=+new Date,this.zendeskHost=t,this.zEQueue=a,this.body.appendChild(o)},o.write('<body onload="document._l();">'),o.close()}("//assets.zendesk.com/embeddable_framework/main.js","{$domain}");/*]]>*/</script>
<!-- End of Zendesk Widget script -->
EOJS;
    $config->saveConfig('zendesk/frontend_features/web_widget_code_snippet', $webWidgetSnippet);
} else {
开发者ID:7ochem,项目名称:magento_extension,代码行数:31,代码来源:data-upgrade-1.4.2-2.0.0.php

示例4: resetConfigAction

 public function resetConfigAction()
 {
     $setup = new Mage_Core_Model_Config();
     foreach (unserialize(Mage::getStoreConfig('gluu/oxd/oxd_openid_custom_scripts')) as $custom_script) {
         $setup->deleteConfig('GluuOxd/Openid/' . $custom_script['value'] . 'Enable');
     }
     $setup->deleteConfig('gluu/oxd/oxd_id');
     $setup->deleteConfig('gluu/oxd/oxd_openid_scops');
     $setup->deleteConfig('gluu/oxd/oxd_config');
     $setup->deleteConfig('gluu/oxd/oxd_openid_scops');
     $setup->deleteConfig('gluu/oxd/oxd_openid_custom_scripts');
     $setup->deleteConfig('GluuOxd/Openid/loginTheme');
     $setup->deleteConfig('GluuOxd/Openid/loginCustomTheme');
     $setup->deleteConfig('GluuOxd/Openid/iconSpace');
     $setup->deleteConfig('GluuOxd/Openid/iconCustomSize');
     $setup->deleteConfig('GluuOxd/Openid/iconCustomWidth');
     $setup->deleteConfig('GluuOxd/Openid/iconCustomHeight');
     $setup->deleteConfig('GluuOxd/Openid/iconCustomColor');
     $this->redirect("*/*/index");
 }
开发者ID:GluuFederation,项目名称:gluu-magento-sso-login-extension,代码行数:20,代码来源:IndexController.php

示例5: array

<?php

/**
 * @package     BlueAcorn\Optimizely
 * @version     1.1.0
 * @author      Blue Acorn, Inc. <code@blueacorn.com>
 * @copyright   Blue Acorn, Inc. 2014
 */
$config = new Mage_Core_Model_Config();
$settings = array('settings/enabled', 'settings/revenue_tracking', 'settings/optimizely_project_code');
foreach ($settings as $setting) {
    $val = Mage::getStoreConfig("optimizely/{$setting}");
    $config->saveConfig("blueacorn_optimizely/{$setting}", $val);
    $config->deleteConfig("optimizely/{$setting}");
}
$cust_attrs = array('project_settings/optimizely_custom_one', 'project_settings/optimizely_custom_two', 'project_settings/optimizely_custom_three', 'project_settings/optimizely_custom_four');
$attributes = array();
foreach ($cust_attrs as $setting) {
    $val = Mage::getStoreConfig("optimizely/{$setting}");
    if ($val) {
        $attributes[] = array('attribute' => $val);
    }
    $config->deleteConfig("optimizely/{$setting}");
}
$config->saveConfig("blueacorn_optimizely/project_settings/attributes", serialize($attributes));
开发者ID:technomagegithub,项目名称:colb2b,代码行数:25,代码来源:data-upgrade-1.0.2-1.1.0.php

示例6: trim

$serviceEnabled = trim(Mage::getStoreConfig('postcodenl/config/enabled'));
$serviceUrl = trim(Mage::getStoreConfig('postcodenl/config/api_url'));
$serviceKey = trim(Mage::getStoreConfig('postcodenl/config/api_key'));
$serviceSecret = trim(Mage::getStoreConfig('postcodenl/config/api_secret'));
$serviceShowcase = Mage::getStoreConfig('postcodenl/config/api_showcase');
$serviceDebug = Mage::getStoreConfig('postcodenl/config/api_debug');
$serviceNeverHideCountry = Mage::getStoreConfig('postcodenl/config/never_hide_country');
$serviceUseStreet2AsHousenumber = Mage::getStoreConfig('postcodenl/config/use_street2_as_housenumber');
// Only do update, if we actually have old configuration (secret being most important to check)
if ($serviceSecret !== '') {
    // Set new basic configuration
    $config->saveConfig('postcodenl_api/config/enabled', $serviceEnabled, 'default', 0);
    $config->saveConfig('postcodenl_api/config/api_key', $serviceKey, 'default', 0);
    $config->saveConfig('postcodenl_api/config/api_secret', $serviceSecret, 'default', 0);
    // Set new advanced configuration
    $config->saveConfig('postcodenl_api/advanced_config/use_street2_as_housenumber', $serviceUseStreet2AsHousenumber, 'default', 0);
    $config->saveConfig('postcodenl_api/advanced_config/never_hide_country', $serviceNeverHideCountry, 'default', 0);
    // Set new development configuration
    $config->saveConfig('postcodenl_api/development_config/api_url', $serviceUrl, 'default', 0);
    $config->saveConfig('postcodenl_api/development_config/api_debug', $serviceDebug, 'default', 0);
    $config->saveConfig('postcodenl_api/development_config/api_showcase', $serviceShowcase, 'default', 0);
}
// Delete old configuration
$config->deleteConfig('postcodenl/config/enabled', 'default', 0);
$config->deleteConfig('postcodenl/config/api_url', 'default', 0);
$config->deleteConfig('postcodenl/config/api_key', 'default', 0);
$config->deleteConfig('postcodenl/config/api_secret', 'default', 0);
$config->deleteConfig('postcodenl/config/api_showcase', 'default', 0);
$config->deleteConfig('postcodenl/config/api_debug', 'default', 0);
$config->deleteConfig('postcodenl/config/never_hide_country', 'default', 0);
$config->deleteConfig('postcodenl/config/use_street2_as_housenumber', 'default', 0);
开发者ID:technomagegithub,项目名称:olgo.nl,代码行数:31,代码来源:data-upgrade-1.0.8.0-1.1.0.0.php


注:本文中的Mage_Core_Model_Config::deleteConfig方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。