Last active
August 29, 2015 13:55
-
-
Save lennartvdd/8706748 to your computer and use it in GitHub Desktop.
Yii bootstrapper for server specific configurations (Yii 1.1.x)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//determine application environment | |
if(!defined('YII_ENV')) { | |
if(($env = getenv('YII_ENV'))===false) { | |
$env='production';//by default | |
} | |
define('YII_ENV', $env); | |
unset($env); | |
} | |
//get default & server config | |
$configMain = require(__DIR__ . '/protected/config/main.php'); | |
$configServer = require(__DIR__ . '/protected/config/server.' . YII_ENV . '.php'); | |
//merge and return config | |
return CMap::mergeArray($configMain, $configServer); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Yii Web Application Entry Script */ | |
// default constants | |
defined('YII_DEBUG') or define('YII_DEBUG', false); | |
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3); | |
// define('YII_ENV', 'development'); //comment out or set OS Environment Variable YII_ENV. Default: production | |
// load framework | |
require_once(__DIR__ . '/../framework/yii.php'); | |
// load configuration | |
$config = require('configure.php'); | |
// start application | |
Yii::createWebApplication($config)->run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment