Suppose we have a config file with sensitive passwords. I\'d like to version control the whole project, including the config file as well, but I don\'t want to share my pass
Create a local overrides file that contains the user specific info as PHP variables.
For instance create a file called local_overrides.php which contains the following:
$local_password = 'qUzaEAFK13uK2KHy';
Then in the file that includes your DB password do something like this
$overrides = 'local_overrides.php';
if (file_exists($overrides)) {
#include_once($overrides);
$db_password = $local_password;
} else {
// perform appropriate action: set default? echo error message? log error?
$db_password = 'l1m1t3d!'
}
The local overrides file would never has to be seen by source control.