mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
do_log() add uid and passkey
This commit is contained in:
+1
-5
@@ -6,11 +6,7 @@ define('ROOT_PATH', $rootpath);
|
|||||||
define('VERSION_NUMBER', '1.6.0');
|
define('VERSION_NUMBER', '1.6.0');
|
||||||
define('CURRENT_SCRIPT', strstr(basename($_SERVER['SCRIPT_FILENAME']), '.', true));
|
define('CURRENT_SCRIPT', strstr(basename($_SERVER['SCRIPT_FILENAME']), '.', true));
|
||||||
define('IS_ANNOUNCE', CURRENT_SCRIPT == 'announce');
|
define('IS_ANNOUNCE', CURRENT_SCRIPT == 'announce');
|
||||||
if (!empty($_SERVER['HTTP_X_REQUEST_ID'])) {
|
define('REQUEST_ID', $_SERVER['HTTP_X_REQUEST_ID'] ?? $_SERVER['REQUEST_ID'] ?? intval(NEXUS_START * 10000));
|
||||||
define('REQUEST_ID', $_SERVER['HTTP_X_REQUEST_ID']);
|
|
||||||
} else {
|
|
||||||
define('REQUEST_ID', intval(NEXUS_START * 10000));
|
|
||||||
}
|
|
||||||
if (!file_exists($rootpath . '.env')) {
|
if (!file_exists($rootpath . '.env')) {
|
||||||
$installScriptRelativePath = 'install/install.php';
|
$installScriptRelativePath = 'install/install.php';
|
||||||
$installScriptFile = $rootpath . "public/$installScriptRelativePath";
|
$installScriptFile = $rootpath . "public/$installScriptRelativePath";
|
||||||
|
|||||||
@@ -147,14 +147,17 @@ function dd($vars)
|
|||||||
|
|
||||||
function do_log($log, $level = 'info')
|
function do_log($log, $level = 'info')
|
||||||
{
|
{
|
||||||
|
global $CURUSER;
|
||||||
$logFile = getLogFile();
|
$logFile = getLogFile();
|
||||||
if (($fd = fopen($logFile, 'a')) !== false) {
|
if (($fd = fopen($logFile, 'a')) !== false) {
|
||||||
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
|
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
|
||||||
$content = sprintf(
|
$content = sprintf(
|
||||||
"[%s] [%s] [%s] %s:%s %s%s%s %s%s",
|
"[%s] [%s] [%s] [%s] [%s] %s:%s %s%s%s %s%s",
|
||||||
date('Y-m-d H:i:s'),
|
date('Y-m-d H:i:s'),
|
||||||
$level,
|
$level,
|
||||||
defined('REQUEST_ID') ? REQUEST_ID : '',
|
defined('REQUEST_ID') ? REQUEST_ID : '',
|
||||||
|
$CURUSER['id'] ?? 0,
|
||||||
|
$CURUSER['passkey'] ?? $_REQUEST['passkey'] ?? '',
|
||||||
$backtrace[0]['file'] ?? '',
|
$backtrace[0]['file'] ?? '',
|
||||||
$backtrace[0]['line'] ?? '',
|
$backtrace[0]['line'] ?? '',
|
||||||
$backtrace[1]['class'] ?? '',
|
$backtrace[1]['class'] ?? '',
|
||||||
|
|||||||
Reference in New Issue
Block a user