Monday 3 September 2012

Disable all Local Modules at Once

         While going through the study guide for the Magento Developer Exam, I’ve been learning a few interesting details that are squirreled away in the Magento code, but can be useful in day to day Magento development.
For example, while going through the section on Module loading, it is revealed that we can easily disable all modules living in the local (app/code/local) namespace by editing app/etc/local.xml and setting the disable_local_modules node to true:


<config>
    <global>
        ...
        <disable_local_modules>true</disable_local_modules>
        ...
    </global>
    ...
</config>
 
 
 
Of course, if you have cache enable, clear or disable it to see the effects.
This will immediately prevent Magento from loading any code from your local code pool. You could use this to troubleshoot issues with custom modules or local Mage overrides. Of course, to find the exact culprit would require disabling individual modules one by one but at least you can narrow down your area of search quickly this way.
Note that this will not affect the community modules.
 

No comments:

Post a Comment