diff options
author | Friendika <info@friendika.com> | 2011-07-05 17:45:33 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-07-05 17:45:33 -0700 |
commit | 1a4a6b5ff90d0d557ed6ea1a1045f9713c83bbbd (patch) | |
tree | 7256cb1261a657cac71684aeda01e967984da1fd /include | |
parent | 308d98f7ac7d72bbaaeb02d7acc228d856c9d660 (diff) | |
download | volse-hubzilla-1a4a6b5ff90d0d557ed6ea1a1045f9713c83bbbd.tar.gz volse-hubzilla-1a4a6b5ff90d0d557ed6ea1a1045f9713c83bbbd.tar.bz2 volse-hubzilla-1a4a6b5ff90d0d557ed6ea1a1045f9713c83bbbd.zip |
explicitly close db connections - do not rely on process exit
Diffstat (limited to 'include')
-rw-r--r-- | include/dba.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/dba.php b/include/dba.php index 49b325cf7..32f1ac3ed 100644 --- a/include/dba.php +++ b/include/dba.php @@ -212,4 +212,13 @@ function dbesc_array(&$arr) { if(is_array($arr) && count($arr)) { array_walk($arr,'dbesc_array_cb'); } -}}
\ No newline at end of file +}} + + +if(! function_exists('closedb')) { +function closedb() { + global $db; + if($db && $db->connected) + $db->close(); +}} + |