Advertisement:

Author Topic: Terminate & Reverse MOD Installation If Not Using mySQL Database  (Read 132 times)

Offline Randem

  • Jr. Member
  • **
  • Posts: 125
  • Gender: Male
    • Randem Systems
Terminate & Reverse MOD Installation If Not Using mySQL Database
« 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:

Code: [Select]
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?
https://randemsystems.com/support/       -   Discusware to SMF Converter
https://blaxtonjames.com                         - Money, Knowledge And Power; Why You Are Missing All Three
https://joystickgangsta.com                      - An Experience You Can't Refuse
http://botbanish.com                                 - The Ultimate BOT Defender

Always ignore those who attempt to tell you what to think and believe those who will let you think for yourself

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,032
    • Arantor on GitHub
Re: Terminate & Reverse MOD Installation If Not Using mySQL Database
« Reply #1 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.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.