From 2372b7f7b0db0476bc76104d8450985387a1ffa3 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Wed, 11 Dec 2024 15:18:05 +0100 Subject: [PATCH] context.php: include ReportQueries --- inc/context.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/inc/context.php b/inc/context.php index 26e9f861..c5fdca68 100644 --- a/inc/context.php +++ b/inc/context.php @@ -2,6 +2,7 @@ namespace Vichan; use Vichan\Data\Driver\{CacheDriver, HttpDriver, ErrorLogLogDriver, FileLogDriver, LogDriver, StderrLogDriver, SyslogLogDriver}; +use Vichan\Data\ReportQueries; use Vichan\Service\HCaptchaQuery; use Vichan\Service\SecureImageCaptchaQuery; use Vichan\Service\ReCaptchaQuery; @@ -92,6 +93,11 @@ function build_context(array $config): Context { // Ensure the PDO is initialized. sql_open(); return $pdo; + }, + ReportQueries::class => function($c) { + $auto_maintenance = (bool)$c->get('config')['auto_maintenance']; + $pdo = $c->get(\PDO::class); + return new ReportQueries($pdo, $auto_maintenance); } ]); }