去除__code__代码的引用

This commit is contained in:
root
2026-06-14 19:44:37 +08:00
parent eb2724e3de
commit 8f46a4c1c4
4 changed files with 1163 additions and 6 deletions
+4 -4
View File
@@ -120,7 +120,7 @@ class FpRiskExplain
private static function loadAnalyzer() private static function loadAnalyzer()
{ {
if (!self::$analyzerLoaded) { if (!self::$analyzerLoaded) {
require_once dirname(__DIR__, 2) . '/__code__/risk_analyzer_new.php'; require_once __DIR__ . '/LogRiskAnalyzer.php';
self::$analyzerLoaded = true; self::$analyzerLoaded = true;
} }
} }
@@ -132,7 +132,7 @@ class FpRiskExplain
} }
self::loadAnalyzer(); self::loadAnalyzer();
try { try {
$analyzer = new RiskAnalyzer($hdata); $analyzer = new LogRiskAnalyzer($hdata);
return $analyzer->analyze(); return $analyzer->analyze();
} catch (Throwable $e) { } catch (Throwable $e) {
return ['error' => $e->getMessage()]; return ['error' => $e->getMessage()];
@@ -417,8 +417,8 @@ class FpRiskExplain
if ($localLevel !== null && $apiLevel !== null && abs($localLevel - $apiLevel) > 3) { if ($localLevel !== null && $apiLevel !== null && abs($localLevel - $apiLevel) > 3) {
$lines[] = [ $lines[] = [
'level' => 'alert', 'level' => 'alert',
'text' => sprintf('API reason 解析风险分 %d本地 risk_analyzer 复算 %d,两者不一致。', $apiLevel, $localLevel), 'text' => sprintf('API reason 解析风险分 %d日志复算风险分 %d,两者不一致。', $apiLevel, $localLevel),
'action' => '线上 byApiRisk 版本可能与本地 __code__/risk_analyzer_new.php 不同步,或 reason 格式有变,需核对 API 部署。', 'action' => '线上 byApiRisk 版本可能与 lib/Cloak/LogRiskAnalyzer.php 不同步,或 reason 格式有变,需核对 API 部署。',
]; ];
} }
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -40,7 +40,7 @@ if (!function_exists('cloak_visitor_log_format_timing')) {
return ''; return '';
} }
if (!class_exists('CloakPipelineTimer', false)) { if (!class_exists('CloakPipelineTimer', false)) {
require_once dirname(__DIR__) . '/Cloak/PipelineTimer.php'; require_once __DIR__ . '/Cloak/PipelineTimer.php';
} }
$decoded = json_decode($raw, true); $decoded = json_decode($raw, true);
if (is_array($decoded)) { if (is_array($decoded)) {
@@ -99,7 +99,7 @@ if (!function_exists('cloak_visitor_log_fp_risk_explain')) {
function cloak_visitor_log_fp_risk_explain($fpHdata, $reason, $result, $domain = '') function cloak_visitor_log_fp_risk_explain($fpHdata, $reason, $result, $domain = '')
{ {
if (!class_exists('FpRiskExplain', false)) { if (!class_exists('FpRiskExplain', false)) {
require_once dirname(__DIR__) . '/Cloak/FpRiskExplain.php'; require_once __DIR__ . '/Cloak/FpRiskExplain.php';
} }
return FpRiskExplain::build($fpHdata, $reason, $result, $domain); return FpRiskExplain::build($fpHdata, $reason, $result, $domain);
} }
Executable
BIN
View File
Binary file not shown.