From 15750f314ccccf80fc086adabdc738d4391fca22 Mon Sep 17 00:00:00 2001 From: Divarion-D Date: Wed, 24 Jun 2026 20:33:55 +0300 Subject: [PATCH] =?UTF-8?q?chore(psr4):=20phase=203=20(Core=20leaf)=20?= =?UTF-8?q?=E2=80=94=20namespace=20Core/Logging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the Core/Logging layer into XcVm\Core\Logging (Logger, LoggerInterface, FileLogger, DatabaseLogger, UpdateLogger). Composer PSR-4 now resolves them. - Add namespace to the 5 logging classes; built-in \Throwable qualified in Logger; same-namespace LoggerInterface references unqualified. - Add 'use XcVm\Core\Logging\...;' to the 16 referencing files (bootstrap, web/stream bootstraps, stream entry points, Database, EPG, update command/cron, auth, ministra) — call sites unchanged. - Authenticator::logRecaptcha: drop the now-dead class_exists/method_exists guard (Logger is always autoloadable post-Composer) and call Logger::log directly. Procedural Core/Error + Core/Config constants files (ErrorCodes/ErrorHandler/ AppConfig/Binaries/Paths — no classes) intentionally left global per plan. Verified: php -l clean; PHPStan no errors; PHPUnit 295/295. --- src/Cli/Commands/UpdateCommand.php | 1 + src/Cli/CronJobs/UpdateCronJob.php | 1 + src/Core/Auth/Authenticator.php | 8 +++----- src/Core/Database/Database.php | 1 + src/Core/Http/RequestGuard.php | 1 + src/Core/Logging/DatabaseLogger.php | 2 ++ src/Core/Logging/FileLogger.php | 2 ++ src/Core/Logging/Logger.php | 10 ++++++---- src/Core/Logging/LoggerInterface.php | 2 ++ src/Core/Logging/UpdateLogger.php | 2 ++ src/Domain/Epg/EPG.php | 1 + .../bootstrap/StreamingRequestBootstrap.php | 1 + src/Infrastructure/bootstrap/WebApiBootstrap.php | 1 + src/Public/stream/auth.php | 1 + src/Public/stream/live.php | 1 + src/Public/stream/rtmp.php | 1 + src/Public/stream/timeshift.php | 1 + src/Public/stream/vod.php | 1 + src/Streaming/Auth/StreamAuthMiddleware.php | 1 + src/bootstrap.php | 1 + src/ministra/MinistraBootstrap.php | 1 + 21 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/Cli/Commands/UpdateCommand.php b/src/Cli/Commands/UpdateCommand.php index 7bbab147..cbb30f78 100644 --- a/src/Cli/Commands/UpdateCommand.php +++ b/src/Cli/Commands/UpdateCommand.php @@ -1,5 +1,6 @@ getMessage(), @@ -181,11 +183,11 @@ final class Logger { /** * Builds a stack trace for an exception chain (including previous exceptions). * - * @param Throwable $e The exception + * @param \Throwable $e The exception * * @return string Formatted trace string */ - private static function buildExceptionTrace(Throwable $e): string { + private static function buildExceptionTrace(\Throwable $e): string { $out = []; do { diff --git a/src/Core/Logging/LoggerInterface.php b/src/Core/Logging/LoggerInterface.php index 9a662267..bfe07dba 100644 --- a/src/Core/Logging/LoggerInterface.php +++ b/src/Core/Logging/LoggerInterface.php @@ -1,5 +1,7 @@