<?php 
error_reporting(E_ERROR || E_WARNING || E_STRICT);
//error_reporting(E_ALL);
if(PHP_VERSION<(5.1))exit('请确保PHP版本在PHP5.1以上');
ob_start();
date_default_timezone_set("Asia/Shanghai");//phpversion >=5.1
@ini_set('memory_limit',          '128M');
@ini_set('session.save_handler','files');
@ini_set('session.auto_start',    0);
@ini_set('session.cache_expire',  180);
@ini_set("session.gc_maxlifetime", 1800);#半小时1800
@ini_set('session.use_trans_sid', 0);
@ini_set('session.use_cookies',   1);
@ini_set('session.use_only_cookies',1);
define('NO_AUTH_LOGIN','你无此操作权限');
define('PUBLIC_ROOT',strtr(dirname(__FILE__).'/',array('\\'=>'/')));
define('INCLUDE_PATH',PUBLIC_ROOT.'include/');
define('SYS_CLASS',PUBLIC_ROOT.'include/classes/');
define('CLASS_PATH',SYS_CLASS);
define('SYS_ROOT',PUBLIC_ROOT);
define('PUB_CLASS',PUBLIC_ROOT.'pub/');
define('PUB_MODEL_PATH',PUBLIC_ROOT.'pub/model/');
define('STATC_CACHE_PATH',SYS_ROOT.'cache/static_cache/');
define('IN_SYS',TRUE);
define('TEMPLATE_MAIN_PATH',SYS_ROOT.'template/');
$config_file = PUBLIC_ROOT.'config.inc.php';
require SYS_ROOT.'include/version.php';
require $config_file;
require PUB_CLASS.'/phpwms.global.function.php'; 
require(INCLUDE_PATH.'classes/cls.db_'.$dbtype.'.php');
$db	   = new $sql_db();
if (!$db -> dbname) {
	$db -> sql_connect($dbhost,$dbuser,$dbpwd,$dbname,$dbport, false, false);
	unset($dbpasswd);
}
$GLOBALS['starttime'] = microtime_float();
$_GET = !get_magic_quotes_gpc()?addslashes_deep_char_request($_GET):$_GET;
$_POST = !get_magic_quotes_gpc()?addslashes_deep_char_request($_POST):$_POST;
$_COOKIE = !get_magic_quotes_gpc()?addslashes_deep_char_request($_COOKIE):$_COOKIE;
$_REQUEST = !get_magic_quotes_gpc()?addslashes_deep_char_request($_REQUEST):$_REQUEST;
$PHP_SELF = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
?>