I am having different environments development and production for a website and each of its database varies.
I have created a module which will connect to an external database. But now I want to make it dynamic like if the environment is dev
then automatic the fields must be entered according to dev and if its prod
then details must be according to prod.
Following is my code:
mod_test.xml
<fieldset name="basic">
<field name="db_hostname" type="text" default="" label="Host Name" description="Enter the Database Host Name" />
<field name="db_port" type="text" default="" label="Port" description="Enter the Database Port Number" />
<field name="db_name" type="text" default="" label="Database Name" description="Enter the Database Name" />
<field name="db_user" type="text" default="" label="Database Username" description="Enter the Database Username" />
<field name="db_password" type="password" default="" label="Database Password" description="Enter the Database Password" />
</fieldset>
Currently, each time I have to change the db details in the administrator according the environments. Therefore I want to make it dynamic and to pre-fill the data according to different environments. Kindly, let me know how to proceed on this.
Thanks for any help