• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Starting with CodeIgniter setup: suggestions & best practices

[eluser]quickshiftin[/eluser]
Although it's an area of contention with the core CI developers I like to make index.php configurable via environment.

Note I use Apache, but this sort of thing is typical in Zend and Symfony too. Here's what the top of my index.php files look like w/ CI:

Code:
// default to development, but look for the APPLICATION_ENV variable
// to control the environment without having a different branch per env
$sEnv = getenv('APPLICATION_ENV');
if($sEnv === false)
    define('ENVIRONMENT', $sEnv = 'development');
else
    define('ENVIRONMENT', $sEnv);

Now inside of an Apache vhost I can set the environment without having to constantly change the CI code.

Code:
SetEnv APPLICATION_ENV production


Messages In This Thread
Starting with CodeIgniter setup: suggestions & best practices - by El Forum - 07-17-2013, 10:57 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.