diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2022-05-26 03:14:50 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2022-05-26 21:51:43 +0300 |
commit | c3ed2483ea508141431be74f29f7c209271897cd (patch) | |
tree | 9f7a416ab433ffc9bd245d1dd382f350a4e61efc /localwebsite/functions.php | |
parent | 997c6da6c40c11ec0bc6cc749f78deca8dd95db1 (diff) |
cron: vk sms checker
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 |