title: Codeigniter - switch between environments
body: <p>By default each codeigniter app has defined environment in the ci.php :</p>
  
  <pre><code>define('ENVIRONMENT', 'development');
  </code></pre>
  
  <p>I need to switch between different countries in my app, and each country has it`s own configuration and database. So I tried to create folder for each country in the 'config' folder and place there all the needed configs. Then I want to select country from a dropdown and switch the environment. Tried like this:</p>
  
  <pre><code>define('ENVIRONMENT', 'mexico');
  </code></pre>
  
  <p>but this raises error:</p>
  
  <blockquote>
    <p>Message: Constant ENVIRONMENT already defined</p>
  </blockquote>
  
  <p>How can I do this ?</p>