From 8d8957cfeb72733d955022d10910fce28689c161 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Tue, 26 Nov 2024 00:34:03 +0100 Subject: [PATCH] context.php: add PDO and database to context --- inc/context.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/inc/context.php b/inc/context.php index 137f6ebd..a85f2f05 100644 --- a/inc/context.php +++ b/inc/context.php @@ -2,6 +2,7 @@ namespace Vichan; use Vichan\Data\Driver\CacheDriver; +use Vichan\Data\ReportQueries; defined('TINYBOARD') or exit; @@ -33,6 +34,12 @@ function build_context(array $config): Context { CacheDriver::class => function($c) { // Use the global for backwards compatibility. return \cache::getCache(); + }, + \PDO::class => function($c) { + global $pdo; + // Ensure the PDO is initialized. + sql_open(); + return $pdo; } ]); }