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); } ]); }