2012-08-09 65 views
0

我在那里,我的Magento内运行多个门店,需要在每家商店的级别禁用模块的网站。从配置中删除一个模块,即使其缓存

这里的第二个答案Magento: Disable module for any particular store确实有效,但是布局缓存需要关闭。这似乎大大增加了服务器负载。

我发现这篇文章由阿兰风暴这似乎是这将有助于http://alanstorm.com/magento_config_a_critique_and_caching

有没有一种方法,我可以剥夺,即使它被从缓存中加载的XML的特定的作品呢?

这似乎是它会哈克不管它是如何实现的,而大部分的扩展名作家似乎并没有建立自己的扩展时采取多网站/店进去。能够完全禁用每个商店的模块并且仍然允许布局高速缓存正常运行将会很好。

回答

0

好吧,我想我想出了这一个。

在/app/code/local/Mage/Core/Model/Config.php(正本)。

public function loadModulesCache() 
{ 
    if (Mage::isInstalled(array('etc_dir' => $this->getOptions()->getEtcDir()))) { 
     if ($this->_canUseCacheForInit()) { 
      Varien_Profiler::start('mage::app::init::config::load_cache'); 
      $loaded = $this->loadCache(); 
      Varien_Profiler::stop('mage::app::init::config::load_cache'); 
      if ($loaded) { 


       ***PUT CODE HERE TO EDIT $this->_xml*** 
       Just remove the nodes which should be disabled. 


       $this->_useCache = true; 
       return true; 
      } 
     } 
    } 
    return false; 
} 

我不知道如果这是最好的方式,如果这甚至应该做的,但我现在要测试,看看是否有任何其他错误弹出