新增maxmind数据库本地判断国家,并且将优先级调整至最高

This commit is contained in:
root
2026-06-14 15:29:29 +08:00
parent 72d388f642
commit eab59c1c18
17 changed files with 912 additions and 38 deletions
+8
View File
@@ -248,6 +248,14 @@ $cfDomainOut = shell_exec(escapeshellarg(PHP_BINARY) . ' ' . escapeshellarg($roo
$cfDomainJson = json_decode((string) $cfDomainOut, true);
reg_assert('Cloudflare 域名自动化 Mock 流转', ($cfDomainJson['ok'] ?? false) === true, (string) $cfDomainOut);
$geoOut = shell_exec(escapeshellarg(PHP_BINARY) . ' ' . escapeshellarg($root . '/tools/verify_geoip.php') . ' 2>/dev/null');
$geoJson = json_decode((string) $geoOut, true);
if (($geoJson['tests']['db_file_exists'] ?? false) === true) {
reg_assert('GeoIP 本地国家库', ($geoJson['ok'] ?? false) === true, (string) $geoOut);
} else {
reg_skip('GeoIP 本地国家库', 'mmdb 未安装,运行 php tools/setup_geoip_db.php');
}
// ── 9. 数据库连通(可选) ─────────────────────────────────────
echo "[9] 数据库\n";
if (defined('DB_NAME')) {