seeding bonus log save to click house

This commit is contained in:
xiaomlove
2025-09-19 21:02:34 +07:00
parent 90c973f608
commit 8bdcacf8e7
15 changed files with 112 additions and 58 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.9.7');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2025-09-17');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2025-09-19');
defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
+1 -1
View File
@@ -305,7 +305,7 @@ function formatSpoiler($content, $title = '', $defaultCollapsed = true): string
}
// $content = str_replace(['<br>', '<br />'], '', $content);
$contentClass = "";
if ($defaultCollapsed) {
if (!$defaultCollapsed) {
$contentClass .= " open";
}
$HTML = sprintf(
+15 -3
View File
@@ -209,11 +209,9 @@ function do_log($log, $level = 'info', $echo = false)
}
}
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
$dt = DateTime::createFromFormat('U.u', sprintf('%.6f', microtime(true)));
$dt->setTimezone(new DateTimeZone(nexus_env('TIMEZONE', 'UTC')));
$content = sprintf(
"[%s] [%s] [%s] [%s] [%s] [%s] %s.%s %s:%s %s%s%s %s%s",
$dt->format("Y-m-d\TH:i:s.vP"),
getDtMillis(true),
nexus() ? nexus()->getRequestId() : 'NO_REQUEST_ID',
nexus() ? nexus()->getLogSequence() : 0,
sprintf('%.3f', microtime(true) - (nexus() ? nexus()->getStartTimestamp() : 0)),
@@ -238,6 +236,20 @@ function do_log($log, $level = 'info', $echo = false)
}
}
function getDtMillis($withTimeZone = false): string {
$dt = DateTime::createFromFormat('U.u', sprintf('%.6f', microtime(true)));
$dt->setTimezone(new DateTimeZone(nexus_env('TIMEZONE', 'UTC')));
$format = $withTimeZone ? 'Y-m-d\TH:i:s.vP' : 'Y-m-d H:i:s.v';
return $dt->format($format);
}
function getDtMicro($withTimeZone = false): string {
$dt = DateTime::createFromFormat('U.u', sprintf('%.6f', microtime(true)));
$dt->setTimezone(new DateTimeZone(nexus_env('TIMEZONE', 'UTC')));
$format = $withTimeZone ? 'Y-m-d\TH:i:s.uP' : 'Y-m-d H:i:s.u';
return $dt->format($format);
}
function getLogFile($append = '')
{
static $logFiles = [];