Browse Source

explicitly close db connections - do not rely on process exit

pull/1/head
Friendika 10 years ago
parent
commit
1a4a6b5ff9
3 changed files with 12 additions and 1 deletions
  1. +1
    -0
      boot.php
  2. +10
    -1
      include/dba.php
  3. +1
    -0
      index.php

+ 1
- 0
boot.php View File

@ -989,6 +989,7 @@ function autoname($len) {
if(! function_exists('killme')) {
function killme() {
session_write_close();
closedb();
exit;
}}


+ 10
- 1
include/dba.php View File

@ -212,4 +212,13 @@ function dbesc_array(&$arr) {
if(is_array($arr) && count($arr)) {
array_walk($arr,'dbesc_array_cb');
}
}}
}}
if(! function_exists('closedb')) {
function closedb() {
global $db;
if($db && $db->connected)
$db->close();
}}

+ 1
- 0
index.php View File

@ -326,4 +326,5 @@ else
require_once(str_replace($lang . '/', '', $template));
session_write_close();
closedb();
exit;

Loading…
Cancel
Save