Moved sql_close() down, after the cache is unloaded.

git-svn-id: file:///svn/phpbb/trunk@4365 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Ludovic Arnaud 2003-08-10 18:42:20 +00:00
parent 145399b4bc
commit 0c3708ecc6
2 changed files with 15 additions and 23 deletions

View file

@ -111,14 +111,14 @@ function adm_page_footer($copyright_html = true)
{
global $cache, $config, $db, $phpEx;
// Close our DB connection.
$db->sql_close();
if (!empty($cache))
{
$cache->unload();
}
// Close our DB connection.
$db->sql_close();
?>
</td>

View file

@ -23,22 +23,13 @@ function set_config($config_name, $config_value, $is_dynamic = FALSE)
{
global $db, $cache, $config;
if (isset($config[$config_name]))
{
if ($config[$config_name] != $config_value)
{
$sql = 'UPDATE ' . CONFIG_TABLE . "
SET config_value = '" . $db->sql_escape($config_value) . "'
WHERE config_name = '$config_name'";
$db->sql_query($sql);
}
}
else
{
$sql = 'DELETE FROM ' . CONFIG_TABLE . "
WHERE config_name = '$config_name'";
$db->sql_query($sql);
$sql = 'UPDATE ' . CONFIG_TABLE . "
SET config_value = '" . $db->sql_escape($config_value) . "'
WHERE config_name = '$config_name'";
$db->sql_query($sql);
if (!$db->sql_affectedrows() && !isset($config[$config_name]))
{
$sql = 'INSERT INTO ' . CONFIG_TABLE . " (config_name, config_value)
VALUES ('$config_name', '" . $db->sql_escape($config_value) . "')";
$db->sql_query($sql);
@ -48,7 +39,7 @@ function set_config($config_name, $config_value, $is_dynamic = FALSE)
if (!$is_dynamic)
{
$cache->put('config', $config);
$cache->destroy('config');
}
}
@ -1401,14 +1392,15 @@ function page_footer()
$template->display('body');
// Close our DB connection.
$db->sql_close();
// Unload cache
// Unload cache, must be done before the DB connection if closed
if (!empty($cache))
{
$cache->unload();
}
// Close our DB connection.
$db->sql_close();
exit;
}