I know that Magento stores database connection data in a local.xml file, however, our company is trying to avoid using passwords and other sensitive data in our git registry for security purposes.
I know that you can easily create environment variables through a .htaccess file, but I hope to find a workable solution that will allow me to dynamically set this database information from an environment variable.
Since local.xml is an XML file, and since this file type is not dynamic / server-side, we cannot use it to read environment variables.
Is there any way to add some kind of hook / custom behavior to Magento in which I could replace local.xml a PHP file that will allow me to use these environment variables?
So, in a sense, local.xml will become a local.PHP file with the ability to read my own custom environment variables such as DB_HOST, DB_USERNAME, DB_PASSWORD , instead of setting them in the XML file as localhost, root, password123 , etc. .
Any ideas on how best to achieve this, or are there any existing Magento add-ons / extensions / extensions / mods that will allow me to do this?
source share