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.
Originally published on magebase.com. Copyright © 2012 Magebase - All Rights Reserved.
Not sure which the original intent of this feature was focused on, but disabling local modules also should give a boost to performance (I’ve not tested it) by reducing the number of paths in the PHP include paths by one. This reduces filesystem accesses every time Magento loads a class which is quite a bit. In theory, this should make a decent performance improvement.
is there a way to disable community module with similar approach?
just wondering.
No, there doesn’t seem to be a similar “switch” for the community code pool.
Thank you, that did the trick! I’ve been looking for this tip
Thanks for this, Im new to magento so this has helped me out
Is it best to disable them or just remove the code completely