context.php: use shared cache driver

This commit is contained in:
Zankaria 2024-04-07 21:10:39 +02:00 committed by Zankaria
parent 842b4fdcee
commit eca2ce0a8f

View file

@ -1,8 +1,11 @@
<?php <?php
namespace Vichan; namespace Vichan;
use Vichan\Data\Driver\CacheDriver;
defined('TINYBOARD') or exit; defined('TINYBOARD') or exit;
class Context { class Context {
private array $definitions; private array $definitions;
@ -27,5 +30,9 @@ class Context {
function build_context(array $config): Context { function build_context(array $config): Context {
return new Context([ return new Context([
'config' => $config, 'config' => $config,
CacheDriver::class => function($c) {
// Use the global for backwards compatibility.
return \cache::getCache();
}
]); ]);
} }