diff options
Diffstat (limited to 'localwebsite/functions.php')
-rw-r--r-- | localwebsite/functions.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/localwebsite/functions.php b/localwebsite/functions.php index c0c4479..f46a534 100644 --- a/localwebsite/functions.php +++ b/localwebsite/functions.php @@ -252,4 +252,14 @@ function append_shutdown_function(callable $f) { function prepend_shutdown_function(callable $f) { global $ShutdownFunctions; array_unshift($ShutdownFunctions, $f); +} + +function getDB(): database { + global $config; + static $link = null; + + if (is_null($link)) + $link = new database($config['database_path']); + + return $link; }
\ No newline at end of file |