<?php
/**
 * @Cscms 3.5 open source management system
 * @copyright 2009-2013 chshcms.com. All rights reserved.
 * @Author:Cheng Jie
 * @Dtime:2013-04-27
 */
//应用环境
define('ENVIRONMENT', 'production');
if (defined('ENVIRONMENT')){
	switch (ENVIRONMENT){
		case 'development':error_reporting(E_ALL);break;
		case 'testing':
		case 'production':error_reporting(0);break;
		default:exit('应用环境的设置不正确。');
	}
}
//文件名称
if (!defined('SELF')) {
    define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
}
// 网站根目录
if (!defined('FCPATH')) {
    define('FCPATH', str_replace(SELF, '', __FILE__));
}
//默认时间
date_default_timezone_set ("Asia/Shanghai");
$system_path = 'cscms';
$application_folder = 'app';
$cscms_folder = 'csdj';
if (defined('STDIN')){
	chdir(dirname(__FILE__));
}
if (realpath($system_path) !== FALSE){
	$system_path = realpath($system_path).'/';
}
$system_path = rtrim($system_path, '/').'/';
if ( ! is_dir($system_path)){
	exit("抱歉，系统响应超时，请稍后再试: ".pathinfo(__FILE__, PATHINFO_BASENAME));
}
define('EXT', '.php');
define('BASEPATH', str_replace("\\", "/", $system_path));
define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
define('PLUGINDIR',str_replace("\\", "/", FCPATH) . 'plugins/'); 
if (is_dir($application_folder)){
	define('APPPATH', $application_folder.'/');
}else{
	if ( ! is_dir(BASEPATH.$application_folder.'/')){
		exit("您的应用程序文件夹的路径不正确设置。请打开下列文件和正确的： ".SELF);
	}
	efine('APPPATH', BASEPATH.$application_folder.'/');
}
if (is_dir($cscms_folder)){
	define('CSCMSPATH', $cscms_folder.'/');
}else{
	if ( ! is_dir(BASEPATH.$cscms_folder.'/')){
		exit("您的应用程序文件夹的路径不正确设置。请打开下列文件和正确的： ".SELF);
	}
	define('CSCMSPATH', BASEPATH.$cscms_folder.'/');
}     	
require_once CSCMSPATH.'lib/Cs_Cscms.php';
require_once BASEPATH.'core/CodeIgniter.php';