Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Randem on December 04, 2017, 08:25:11 AM

Title: Terminate & Reverse MOD Installation If Not Using mySQL Database
Post by: Randem on December 04, 2017, 08:25:11 AM
I have looked and found nothing on this topic, so I am asking how can I Terminate & Reverse MOD Installation If Not Using mySQL Database?

Basically in the code directive section of the Package-info.xml.file in the code I basically want to do something like this:


if (($db_type != 'mysql') && ($db_type{!= 'mysqli')){
fatal_lang_error 'Only mySQL database supported at this time!', false);
}


But instead of the return, I want to exit and have the Package Manager not to continue installation of the MOD and to reverse anything that was done.
How can this be achieved?
Title: Re: Terminate & Reverse MOD Installation If Not Using mySQL Database
Post by: Arantor on December 04, 2017, 08:31:48 AM
You can try putting it in the install.php file instead and document it on the mod's page.

In reality the number of non-MySQL users is sufficiently small that it shouldn't be much of a problem, and SMF provides a decent amount of abstraction functionality to help.