context.php: add ReportQueries class

This commit is contained in:
Zankaria 2024-11-26 00:37:57 +01:00
parent 8d8957cfeb
commit f6deafbc34

View file

@ -40,6 +40,12 @@ 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);
$cache = $c->get(CacheDriver::class);
return new ReportQueries($pdo, $cache, $auto_maintenance);
}
]);
}