Created
April 4, 2017 09:49
-
-
Save KaySchneider/a4d78438b70b0ba4524f852ac57a8b0b to your computer and use it in GitHub Desktop.
How to deactiavate a magento module programmatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MySuperController { | |
protected function _disableModule($moduleName) { | |
// Disable the module itself | |
$nodePath = "modules/$moduleName/active"; | |
if (Mage::helper('core/data')->isModuleEnabled($moduleName)) { | |
Mage::getConfig()->setNode($nodePath, 'false', true); | |
} | |
// Disable its output as well (which was already loaded) | |
$outputPath = "advanced/modules_disable_output/$moduleName"; | |
if (!Mage::getStoreConfig($outputPath)) { | |
Mage::app()->getStore()->setConfig($outputPath, true); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment