Open mrcage opened 3 years ago
dotenv sounds good. In a first step can then use the env files to configure pimple/silex and once we move over to symfony we can easily integrate this with the framework. Would definitely want to avoid accessing super globals outside of the app bootstrap
Store database configuration in
.env
file. The.env
file shall be excluded from git, but an.env.example
file should be added with sample values, e.g.This will make it easier to change these values based on the environment, as there are many ways to pass environment variables to an application. The
htdocs/config/db.conf
file should be removed in this process, and the install script adapted accordingly.Use the symfony dotenv library (https://github.com/symfony/dotenv) to load the contents of the file, and access the values using
$_ENV
superglobal where appropriate (or maybe there is a better way for accessing the variables, open for recommendations).