From 04de500173a8f951dd888b35e8c3b7c1c6ac0dcb Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 30 Apr 2024 03:51:11 +0300 Subject: [PATCH] fix debug template --- example/config.json | 2 +- src/server.php | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/example/config.json b/example/config.json index 1e2beb0..f860fbf 100644 --- a/example/config.json +++ b/example/config.json @@ -69,7 +69,7 @@ "debug": { "enabled":true, - "template":"[{time}] [{code}] {host}:{port} {path} {size} bytes {data}" + "template":"[{time}] {host}:{port} captcha: {code} sent: {sent} length: {size} bytes {data}" } } }, diff --git a/src/server.php b/src/server.php index 8ed40e2..534d5d7 100644 --- a/src/server.php +++ b/src/server.php @@ -169,6 +169,7 @@ $server->setHandler( ): ?string { global $config; + global $code; // @TODO save content in blockchain with kevacoin-php @@ -188,7 +189,8 @@ $server->setHandler( '{time}', '{host}', '{port}', - '{path}', + '{sent}', + '{code}', '{size}', '{data}' ], @@ -196,7 +198,8 @@ $server->setHandler( (string) date('c'), (string) parse_url($url, PHP_URL_HOST), (string) parse_url($url, PHP_URL_PORT), - (string) str_replace('%', '%%', $request), + (string) str_replace('%', '%%', trim($request)), + (string) is_null($code) ? '[off]' : $code, (string) mb_strlen($content), (string) PHP_EOL . $content . PHP_EOL, ],