From 826503f4e62ec827f1ab468f48ac19bd7bdb04c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Thu, 8 Jan 2026 08:26:08 +0000 Subject: [PATCH] add println function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 向林 --- function.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/function.php b/function.php index c887e49c..adf274d3 100644 --- a/function.php +++ b/function.php @@ -6,6 +6,7 @@ defined('APP_PATH') or define('APP_PATH', realpath(__DIR__ . '/../../')); use JetBrains\PhpStorm\Pure; use Kiri\Abstracts\Kernel; use Kiri\Application; +use Kiri\Error\StdoutLogger; use Kiri\Config\ConfigProvider; use Kiri\Core\ArrayAccess; use Kiri\Di\Context; @@ -45,6 +46,22 @@ if (!function_exists('json_validate')) { } +if (!function_exists('println')) { + + + /** + * @param string $data + * @return bool + */ + function println(string $data): void + { + $logger = \Kiri::getDi()->get(StdoutLogger::class); + $logger->println($data); + } + +} + + if (!function_exists('application')) { /**