<?php
	if (!defined('THINK_PATH')) exit();
	$db_config	=	require './db_config.php';
	$sys_config = require './sys_config.php';
	function getConfVal($keys)
	{		
		$db_config	=	require './db_config.php';
		$link = @mysql_connect($db_config['DB_HOST'].":".$db_config['DB_PORT'], $db_config['DB_USER'], $db_config['DB_PWD']);
		@mysql_select_db($db_config['DB_NAME'],$link);		
		$sql = "SELECT name,val FROM ".$db_config['DB_PREFIX']."sys_conf WHERE status=1 and name in(".$keys.")";
		$result = mysql_query($sql);						
		$res = array();
		while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
	       $res[$row[0]] = $row[1];
	    }
		mysql_close($link);
	    return $res;
	}
	$ext_config = getConfVal("'URL_MODEL','PAGE_LISTROWS','SHOP_URL','TOKEN_ON'");
	$array=array(
		'TOKEN_NAME'=>'_sunnyi_hash__',    // 令牌验证的表单隐藏字段名称
		//路由功能配置
		'URL_ROUTER_ON'	=>	true,
		'URL_PATHINFO_DEPR'     => '-',			// 参数之间的分割符号
		'URL_HTML_SUFFIX'       => '.shtml',  	// URL伪静态后缀设置	
		'URL_CASE_INSENSITIVE'  =>  false,   // URL地址是否不区分大小写
		//关于模板
		'TMPL_TEMPLATE_SUFFIX'  => '.moban',     // 默认模板文件后缀
	    'TMPL_CACHE_ON'			=>  false,       // 模板缓存，在多语环境下必需关闭
	    'TMPL_CACHE_TIME'		=>	-1,          // 模板缓存有效期 -1 为永久，(以数字为值，单位:秒)
	    'TMPL_ACTION_ERROR'     => 'Public:success', // 默认错误跳转对应的模板文件
	    'TMPL_ACTION_SUCCESS'   => 'Public:success', // 默认成功跳转对应的模板文件
	    'TMPL_TRACE_FILE'       =>  BASE_PATH.'/global/PageTrace.tpl.php',     // 页面Trace的模板文件
	    'TMPL_EXCEPTION_FILE'   =>  BASE_PATH.'/global/Exception.tpl.php',// 异常页面的模板文件
		
		'VAR_LANGUAGE'	=> 'lang',
	);	
	$config = array_merge($sys_config,$db_config,$array,$ext_config);	
	return $config;
?>