Creating A New Database Driver

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

..Thanks..

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.

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.