Файл: silawar.ru/index.php
Строк: 45
<?php
define('HOST', 'mland.mobi');
$yii=dirname(__FILE__).'/framework/yiilite.php';
if($_SERVER['HTTP_HOST'] === HOST) {
$config = dirname(__FILE__).'/protected/config/production.php';
}
else {
$config = dirname(__FILE__).'/protected/config/development.php';
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
}
require_once($yii);
$app = Yii::createWebApplication($config);
$myparamtable = AppParams::model()->findAll();
foreach( $myparamtable as $key => $value )
{
$app->params->add($value->name_param, $value->value_param);
}
/*
* Здесь буду хранить свои собственные константы
*/
define ('IN_BATTLE', 0);
//Констатнты для вещей
define ('ITEM_ON_BODY', 0);
define ('ITEM_IN_BACKPACK', 1);
define ('ITEM_IN_STORE', 2);
define ('ITEM_IN_MAIL', 3);
define ('ITEM_IN_AUCTION', 4);
define ('ITEM_DESTROY', 5);
//Константы для аука
define ('AUCTION_ITEM', 1);
define ('AUCTION_RES', 2);
Yii::app()->onBeginRequest = function($event) {
return ob_start("ob_gzhandler");
};
Yii::app()->onEndRequest = function($event) {
if (ob_get_level())
return ob_end_flush();
};
$app->run();