Created
October 20, 2016 06:07
-
-
Save firstred/650297071e146274f071a2faf9e79b47 to your computer and use it in GitHub Desktop.
Automatically disable faulty PrestaShop modules
This file contains hidden or 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
| function moduleExceptionHandler($exception) { | |
| $class = $exception->getTrace()[0]['class']; | |
| $module = new $class(); | |
| if (is_subclass_of($module, 'Module')) { | |
| $module->disable(); | |
| } | |
| } | |
| set_exception_handler('moduleExceptionHandler'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment