1
0
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:
Zankaria 2024-11-26 00:34:03 +01:00
parent 47432f9ae5
commit e18f5e5130

View File

@ -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;
} }
]); ]);
} }