//å¼€å¯register_globals会有诸多ä¸å®‰å…¨å¯èƒ½æ€§ï¼Œå› æ¤å¼ºåˆ¶è¦æ±‚å…³é—register_globals
if ( ini_get('register_globals') )
{
exit('php.ini register_globals must is Off! ');
}
//ç¦æ¢ session.auto_start
if ( ini_get('session.auto_start') != 0 )
{
exit('php.ini session.auto_start must is 0 ! ');
}
//检查和注册外部æ交的å˜é‡
foreach($_REQUEST as $_k=>$_v)
{
if( strlen($_k)>0 && eregi('^(cfg_|GLOBALS)',$_k) )
{
exit('Request var not allow!');
}
}
//是å¦å¯ç”¨mb_substr替æ¢cn_substræ¥æ高效率
$cfg_is_mb = $cfg_is_iconv = false;
if(function_exists('mb_substr')) $cfg_is_mb = true;
if(function_exists('iconv_substr')) $cfg_is_iconv = true;
function _RunMagicQuotes(&$svar)
{
if(!get_magic_quotes_gpc())
{
if( is_array($svar) )
{
foreach($svar as $_k => $_v) $svar[$_k] = _RunMagicQuotes($_v);
}
else
{
$svar = addslashes($svar);
}
}
return $svar;
}
foreach(Array('_GET','_POST','_COOKIE') as $_request)
{
foreach($$_request as $_k => $_v) ${$_k} = _RunMagicQuotes($_v);
}
//系统相关å˜é‡æ£€æµ‹
if(!isset($needFilter))
{
$needFilter = false;
}
$registerGlobals = @ini_get("register_globals");
$isUrlOpen = @ini_get("allow_url_fopen");
$isSafeMode = @ini_get("safe_mode");
if( eregi('windows', @getenv('OS')) )
{
$isSafeMode = false;
}
//Sessionä¿å˜è·¯å¾„
$sessSavePath = DEDEDATA."/sessions/";
if(is_writeable($sessSavePath) && is_readable($sessSavePath))
{
session_save_path($sessSavePath);
}
//系统é…ç½®å‚æ•°
require_once(DEDEDATA."/config.cache.inc.php");
//转æ¢ä¸Šä¼ 的文件相关的å˜é‡åŠå®‰å…¨å¤„ç†ã€å¹¶å¼•ç”¨å‰å°é€šç”¨çš„ä¸Šä¼ å‡½æ•°
if($_FILES)
{
require_once(DEDEINC.'/uploadsafe.inc.php');
}
//æ•°æ®åº“é…置文件
require_once(DEDEDATA.'/common.inc.php');
//载入系统验è¯å®‰å…¨é…ç½®
if(file_exists(DEDEDATA.'/safe/inc_safe_config.php'))
{
require_once(DEDEDATA.'/safe/inc_safe_config.php');
if(!empty($safe_faqs)) $safefaqs = unserialize($safe_faqs);
}
//php5.1版本以上时区设置
//由于这个函数对于是php5.1ä»¥ä¸‹ç‰ˆæœ¬å¹¶æ— æ„ä¹‰ï¼Œå› æ¤å®žé™…上的时间调用,应该用MyDate函数调用
if(PHP_VERSION > '5.1')
{
$time51 = $cfg_cli_time * -1;
@date_default_timezone_set('Etc/GMT'.$time51);
}
$cfg_isUrlOpen = @ini_get("allow_url_fopen");
//用户访问的网站host
$cfg_clihost = 'http://'.$_SERVER['HTTP_HOST'];
//ç«™ç‚¹æ ¹ç›®å½•
$cfg_basedir = eregi_replace($cfg_cmspath.'/include$','',DEDEINC);
if($cfg_multi_site == 'Y')
{
$cfg_mainsite = $cfg_basehost;
}
else
{
$cfg_mainsite = '';
}
//模æ¿çš„å˜æ”¾ç›®å½•
$cfg_templets_dir = $cfg_cmspath.'/templets';
$cfg_templeturl = $cfg_mainsite.$cfg_templets_dir;
$cfg_templets_skin = empty($cfg_df_style)? $cfg_mainsite.$cfg_templets_dir."/default" : $cfg_mainsite.$cfg_templets_dir."/$cfg_df_style";
//cms安装目录的网å€
$cfg_cmsurl = $cfg_mainsite.$cfg_cmspath;
//æ’件目录,这个目录是用于å˜æ”¾è®¡æ•°å™¨ã€æŠ•ç¥¨ã€è¯„论ç‰ç¨‹åºçš„å¿…è¦åŠ¨æ€ç¨‹åº
$cfg_plus_dir = $cfg_cmspath.'/plus';
$cfg_phpurl = $cfg_mainsite.$cfg_plus_dir;
$cfg_data_dir = $cfg_cmspath.'/data';
$cfg_dataurl = $cfg_mainsite.$cfg_data_dir;
//会员目录
$cfg_member_dir = $cfg_cmspath.'/member';
$cfg_memberurl = $cfg_mainsite.$cfg_member_dir;
//专题列表的å˜æ”¾è·¯å¾„
$cfg_special = $cfg_cmspath.'/special';
$cfg_specialurl = $cfg_mainsite.$cfg_special;
//附件目录
$cfg_medias_dir = $cfg_cmspath.$cfg_medias_dir;
$cfg_mediasurl = $cfg_mainsite.$cfg_medias_dir;
//ä¸Šä¼ çš„æ™®é€šå›¾ç‰‡çš„è·¯å¾„,建议按默认
$cfg_image_dir = $cfg_medias_dir.'/allimg';
//ä¸Šä¼ çš„ç¼©ç•¥å›¾
$ddcfg_image_dir = $cfg_medias_dir.'/litimg';
//用户投稿图片å˜æ”¾ç›®å½•
$cfg_user_dir = $cfg_medias_dir.'/userup';
//ä¸Šä¼ çš„è½¯ä»¶ç›®å½•
$cfg_soft_dir = $cfg_medias_dir.'/soft';
//ä¸Šä¼ çš„å¤šåª’ä½“æ–‡ä»¶ç›®å½•
$cfg_other_medias = $cfg_medias_dir.'/media';
//软件摘è¦ä¿¡æ¯ï¼Œ****请ä¸è¦åˆ 除本项**** å¦åˆ™ç³»ç»Ÿæ— 法æ£ç¡®æŽ¥æ”¶ç³»ç»Ÿæ¼æ´žæˆ–å‡çº§ä¿¡æ¯
$cfg_version = 'V56_GBK';
$cfg_soft_lang = 'gb2312';
$cfg_soft_public = 'base';
$cfg_softname = '织梦内容管ç†ç³»ç»Ÿ';
$cfg_soft_enname = 'DedeCms';
$cfg_soft_devteam = 'Dedecms官方团队';
//文档的默认命å规则
$art_shortname = $cfg_df_ext = '.html';
$cfg_df_namerule = '{typedir}/{Y}/{M}{D}/{aid}'.$cfg_df_ext;
//新建目录的æƒé™ï¼Œå¦‚æžœä½ ä½¿ç”¨åˆ«çš„å±žæ€§ï¼Œæœ¬ç¨‹ä¸ä¿è¯ç¨‹åºèƒ½é¡ºåˆ©åœ¨Linux或Unix系统è¿è¡Œ
if(isset($cfg_ftp_mkdir) && $cfg_ftp_mkdir=='Y')
{
$cfg_dir_purview = '0755';
}
else
{
$cfg_dir_purview = 0755;
}
//会员是å¦ä½¿ç”¨ç²¾ç®€æ¨¡å¼ï¼ˆå·²ç¦ç”¨ï¼‰
$cfg_mb_lit = 'N';
//特殊全局å˜é‡
$_sys_globals['curfile'] = '';
$_sys_globals['typeid'] = 0;
$_sys_globals['typename'] = '';
$_sys_globals['aid'] = 0;
if(empty($cfg_addon_savetype))
{
$cfg_addon_savetype = 'Ymd';
}
if($cfg_sendmail_bysmtp=='Y' && !empty($cfg_smtp_usermail))
{
$cfg_adminemail = $cfg_smtp_usermail;
}
if(!isset($cfg_NotPrintHead)) {
header("Content-Type: text/html; charset={$cfg_soft_lang}");
}
//引入数æ®åº“ç±»
require_once(DEDEINC.'/dedesql.class.php');
//全局常用函数
require_once(DEDEINC.'/common.func.php');
?>