Skip to content

PHP CodeIgniter Initial Modifications

Hunter Wu edited this page Jan 16, 2019 · 1 revision

System

PHP CodeIgniter System Modifications

application/index.php

session_start();
define('IS_DEV', getenv('PHP_ENV') === 'DEV');
# 3.x.x
$_SERVER['CI_ENV'] = IS_DEV ? 'development' : 'production';
# 1.7.x
	define('ENVIRONMENT', IS_DEV ? 'development' : 'production');

application/config/config.php

  • Add email settings
$config["email"]["protocol"]      = "smtp";
$config["email"]["smtp_host"]     = "smtp.mandrillapp.com";
$config["email"]["smtp_user"]     = "";
$config["email"]["smtp_pass"]     = "";
$config["email"]["smtp_port"]    	= "587";
$config["email"]["smtp_timeout"]	= 5;
  • Modifications
$config['index_page'] = '';
$config['log_threshold'] = IS_DEV ? 2 : 1;
$config['log_path'] = '/var/www/log/ci/';
$config['encryption_key'] = 'YOUR.ENC.KEY!!';

application/config/constants.php

  • Definations
  • IS_CLI
  • ADM_IP
  • FB_APP_ID, FB_APP_SECRET
  • UGC_ROOT_PATH, STATIC_URL, UGC_URL
Clone this wiki locally