Skip to content

Instantly share code, notes, and snippets.

@firstred
Created October 20, 2016 06:07
Show Gist options
  • Select an option

  • Save firstred/650297071e146274f071a2faf9e79b47 to your computer and use it in GitHub Desktop.

Select an option

Save firstred/650297071e146274f071a2faf9e79b47 to your computer and use it in GitHub Desktop.
Automatically disable faulty PrestaShop modules
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