<?php
	
/*the hdwiki entrance */
# 调试模式：0=生产环境（只报Fatal），1=开发模式（全报）
# 【安全补丁】生产环境必须为 0，防止泄露绝对路径、SQL、变量名
$_HDWIKI_DEBUG = 1;
if ($_HDWIKI_DEBUG >= 1) {
    ini_set('display_errors', 1);
    ini_set('display_startup_errors', 1);
    error_reporting(E_ALL);
    # 调试模式：每次访问自动清除PHP字节码缓存，确保读到最新文件
    if (function_exists('opcache_reset')) { @opcache_reset(); }
    if (function_exists('apc_clear_cache')) { @apc_clear_cache(); }
} else {
    # PHP 8 生产环境：屏蔽 Warning / Notice / Deprecated，只显示致命错误
    ini_set('display_errors', 0);
    ini_set('display_startup_errors', 0);
    # 如果需要排查问题，把下行注释改为 error_reporting(E_ALL);
    error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE & ~E_DEPRECATED & ~E_USER_DEPRECATED & ~E_STRICT);
}

# 【安全补丁】全站公共安全函数（避免主站和移动端 m/index.php 各写一份，改一个漏一个）
# 新增安全工具函数请统一放到 lib/security.functions.php
include __DIR__ . '/lib/security.functions.php';

if(function_exists('set_magic_quotes_runtime')){
	@set_magic_quotes_runtime(0);
}
$mtime = explode(' ', microtime());
$starttime = $mtime[1] + $mtime[0];
define('HDWAP_NEW',FALSE);
define('IN_HDWIKI', TRUE);
define('HDWIKI_ROOT', dirname(__FILE__));

include HDWIKI_ROOT.'/model/hdwiki.class.php';

$hdwiki = new hdwiki();
$hdwiki->run();
?>