forked from leftypol/leftypol
context.php: add PDO and database to context
This commit is contained in:
parent
72e2d02cca
commit
8d8957cfeb
1 changed files with 7 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
||||||
namespace Vichan;
|
namespace Vichan;
|
||||||
|
|
||||||
use Vichan\Data\Driver\CacheDriver;
|
use Vichan\Data\Driver\CacheDriver;
|
||||||
|
use Vichan\Data\ReportQueries;
|
||||||
|
|
||||||
defined('TINYBOARD') or exit;
|
defined('TINYBOARD') or exit;
|
||||||
|
|
||||||
|
@ -33,6 +34,12 @@ function build_context(array $config): Context {
|
||||||
CacheDriver::class => function($c) {
|
CacheDriver::class => function($c) {
|
||||||
// Use the global for backwards compatibility.
|
// Use the global for backwards compatibility.
|
||||||
return \cache::getCache();
|
return \cache::getCache();
|
||||||
|
},
|
||||||
|
\PDO::class => function($c) {
|
||||||
|
global $pdo;
|
||||||
|
// Ensure the PDO is initialized.
|
||||||
|
sql_open();
|
||||||
|
return $pdo;
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue