forked from leftypol/leftypol
context.php: use shared cache driver
This commit is contained in:
parent
842b4fdcee
commit
eca2ce0a8f
1 changed files with 7 additions and 0 deletions
|
@ -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();
|
||||||
|
}
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue