mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-02-02 12:57:35 +01:00
context.php: add PDO to context
This commit is contained in:
parent
47432f9ae5
commit
e18f5e5130
@ -86,6 +86,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…
x
Reference in New Issue
Block a user