<?php
/*
 * The Core Initialize
 * @package: PerfCMS
 */

// System
define('APP_ROOT', realpath(dirname(__FILE__)));
define('APP_SYS', APP_ROOT .'/system/');
// Start of sessions
session_start();
mb_internal_encoding('UTF-8');
/*
 * Intitalize Yii framework and System configuration
 */
 
ini_set('max_upload_filesize', '20MB');
ini_set('post_max_size', '20MB');
 
$yiiInitFile = APP_SYS .'/yii.php';
$globalSystemConfig = APP_ROOT .'/protected/config/main.php';
// Require Yii framework

// check db configuration, if not exists go to install
if(!file_exists(APP_SYS.'/data/ini/db.php'))
{
	header('location: /install/');
	exit;
}

require_once($yiiInitFile);
// Initialize system
Yii::createWebApplication($globalSystemConfig)->run();

