WHMCS / sample-addon-module

Sample Addon Module for WHMCS
MIT License
66 stars 73 forks source link

Update activate/deactivate/upgrade functions to use Capsule #2

Open salt-lick opened 7 years ago

salt-lick commented 7 years ago
     $query = "CREATE TABLE `mod_addonexample` (`id` INT( 1 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,`demo` TEXT NOT NULL )";
    full_query($query);

SQL Helper Functions

Per the docs, WHMCS has deprecated SQL helpers. However, I keep seeing code created / updated from WHMCS that still uses them. Is there an idea on when those helper functions will be removed?

mattpugh commented 7 years ago

While they are deprecated and we do encourage using Capsule and in particular the Models (http://docs.whmcs.com/classes) wherever possible, we have no plans to remove support for them at this time. You can expect them to be around as long as it is possible to support them.

jozephbrasil commented 7 years ago

In this case, is suggested to change sample projects to use the new classes instead of old and deprecated examples.

mattpugh commented 7 years ago

I have updated the title of this issue to be about updating the sample module to make use of Capsule in place of the SQL Helper functions and we'll use this to track this being completed.

salt-lick commented 7 years ago

Thanks Matt. As someone that uses / codes against WHMCS all day long and interacts with numerous externally developed plugins, I keep seeing the uses of the SQL helpers perpetuated across the WHMCS ecosystem. I was just fearing that one near release was going to have these helpers pulled.

So, seeing sample code being disseminated from the mothership that used the SQL helpers instead of Capsule was just troubling.

Thanks for letting us they are going to stick around for a bit longer and working on updating the sample code to use the preferred method.

WHMCSPeter commented 5 years ago

This issue has been resolved in PR #11.