XF 1.2 How to disable addon via code

Hi, my site + forum recently died, showing an exceeded max_user_connections. I contacted my host and this was the answer I got from them:

I was able to replicate the reported issue with receiving 'max_user_connections' error in your website at [...] forum. Usually this error generates when the user of the database from which website is fetching exceeds the maximum concurrent connection limit. The maximum concurrent connections we provide on our server is 10 per database user. However, I have created the new user [...] for the database [...] and when I have tried to access the database with newly created user through PhpMyAdmin before accessing the website it has loaded fine. But, once I have updated the new database user to config.php file and tried to access the website, it was loading for a long time and after couple of minutes the website loaded with same error message. Also, later I was unable to access the database with new user through PhpMyAdmin. It appears to be that the database user exceeding the maximum concurrent connection limit from any recently installed or corrupted plugin/module or due to the changes which you might have done.

To overcome this issue, you can condense the amount of queries your script uses by optimizing your SQL usage. Also, please make sure that the script in your website files are closing the connections to the database after connecting and fetching the content. Or else please re-upload the working conditioned copy of your website files/folders from your local backup and check the website functionality.
The latest addon I installed was for my XenForo forum and was [bd] Widget Framework v2.4.3. I enabled a html-widget for it, then disabled the widget shortly after. Now, since I can't load the forum at all I can't get into admin and remove the plugin. I still have access to the FTP so now I need to know where/how to disable this addon via code. Could anyone help?


Well-known member
Stick this at the bottom of your /library/config.php file and restart apache:
It will disable all your addons and let you back in.
$config['enableListeners'] = false;