Codeigniter - switch between environments Codeigniter - switch between environments codeigniter codeigniter

Codeigniter - switch between environments


Constant: A constant is an identifier (name) for a simple value. As the name suggests, that value cannot change during theexecution of the script

So there is no scope to redefine the value of ENVIRONMENT constant as it is already defined. You can use another constant name [except ENVIRONMENT or the other which are already used by codeignitor] or preferable a variable to maintain your country related version.


In your root folder there is an file call index.php(image attach below)

01

In here if you define 'development', It will show your errors on your Codeigniter framework.

For example if database error occurs it shows this kind of error

enter image description here

So this you can check whats wrong and all.

You can test it by define to testing or production. So that you will only get blank page instead of Error Details.

and i there is no use of define a such variable call mexico

Read This Articles

  1. Handling Multiple Environments
  2. What is Development Environment?


You can try to make this in you index.php

switch( $_POST['env']) { case 'mexico' : define('ENVIRONMENT', 'mexico'); break; //etc ...}