Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Creating A New Database Driver Rate Topic   - - - - -

  • judoscott
  • Advanced Member
  • Members
  • Join Date: 19-Mar 16
  • 97 posts

Posted 15 June 2016 - 06:10 PM #1

I'd post this in the developer forum but I can't yet for some reason :-/


I need to create a new database driver to support SSL connections to remote mysql. Creating the driver was easy I just created it in the app/Tygh/Backend/Database/ and changed the config.local.php file to load it.


I want to make sure I am doing this per the documentation though so I have a few questions:

  • Is this the appropriate location to create and deploy this driver? I tried to create this in addons but addons  are loaded after the database driver is instantiated.
  • Am I missing something with addons? Is there a way to load classes in an addon before the Database driver is instantiated?
  • If it was in addons I would of made my custom settings ( ie pem file locations ) in the config file of the addons. Since this doesn't seem to be possible should the settings be in the local_conf.php or would it be more appropriate to push them in the local.config.php





  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22935 posts

Posted 16 June 2016 - 08:57 AM #2

At the moment it is impossible to add database driver through addon. Even if the class will be loaded before addon, you will not be able to get addon settings properly. All you can do through addon is to stop current (non SSL) database connection, rewrite database driver and initialize it during addon initialization. In this case you will be able to use addon settings properly.

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)

  • judoscott
  • Advanced Member
  • Members
  • Join Date: 19-Mar 16
  • 97 posts

Posted 16 June 2016 - 12:22 PM #3

Thanks that confirms what I have discovered then.


So using my current approach seems most correct. From what I have read I think a new driver file will be untouched on updates as long as its not using the same name and location of a file CS-Cart deploys.


Do they ever replace the config.local.php though?


I have to add the locations of the certificates and key files that aren't used by the vanilla cs-cart I don't want them lost on updates.