request_id prefix think about SCRIPT_NAME

This commit is contained in:
xiaomlove
2021-06-01 16:40:53 +08:00
parent 0b839c5970
commit c2446aa1e7
3 changed files with 1 additions and 1 deletions

View File

@@ -19,7 +19,7 @@ if (!defined('REQUEST_ID')) {
} elseif (!empty($_SERVER['REQUEST_ID'])) {
$requestId = $_SERVER['REQUEST_ID'];
} else {
$prefix = implode('', $_SERVER['argv'] ?? []);
$prefix = ($_SERVER['SCRIPT_FILENAME'] ?? '') . implode('', $_SERVER['argv'] ?? []);
$requestId = bin2hex(random_bytes(11)) . str_replace('.', '', substr(uniqid($prefix, true), 12, 10));
}
define('REQUEST_ID', $requestId);