Advertisement:

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

Offline Randem

  • Jr. Member
  • **
  • Posts: 179
  • 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 / BotBanish Support
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 for SMF, OpenCart, WordPress  & Websites

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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,656
    • StoryBB/StoryBB 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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.