context.php: include ReportQueries

This commit is contained in:
Zankaria 2024-12-11 15:18:05 +01:00
parent e18f5e5130
commit 2372b7f7b0

View File

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