title: How to make ZF2 db credentials environment specific
body: <p>I am starting a new project. </p>
  
  <p>I am using ZF2. I have just installed it and have the Skeleton application up and running. </p>
  
  <p>This is my deployment process:</p>
  
  <ul>
  <li>I develop on my local machine</li>
  <li>I then push to my public github repository</li>
  <li>I then use deployhq.com to deploy those to my production
  server which is where the user would see the changes made.</li>
  </ul>
  
  <p>I have tried to look around stack, zend site, and google at blogs etc but still dont have any real understanding or solution to my problem. </p>
  
  <p>I want the application to use different database credentials based on its environment. E.g. if on 'dev', my local machine, then use credentials A, but if on live server, then use credentials B. </p>
  
  <p>I have read a lot about global and local autoload config files etc, but baring in mind my github repo is public, any where I commit any config files with my db details would be visible. </p>
  
  <p>I was wondering if there was a way to have, the same theory, global and local files with the DB connections in, i upload the production details manually, not via git for security reason, and tell git to ignore the local config file somehow? I would also need to know how I tell the application to use those config files based on the environment and there location. </p>