This will now clear system/user level cache when adding/deleting apps.

This commit is contained in:
skeeter 2002-01-13 17:20:33 +00:00
parent 2f00aa1545
commit 1f4c69b108
2 changed files with 25 additions and 13 deletions

View File

@ -191,6 +191,28 @@
return $major;
}
/*!
@function clear_session_cache
@abstract Clear system/user level cache so as to have it rebuilt with the next access
@param None
*/
function clear_session_cache()
{
$tablenames = @$this->db->table_names();
while(list($key,$val) = @each($tablenames))
{
$tables[] = $val['table_name'];
}
if ($this->isinarray('phpgw_app_sessions',$tables))
{
$this->db->lock(array('phpgw_app_sessions'));
@$this->db->query("DELETE FROM phpgw_app_sessions WHERE sessionid = '0' and loginid = '0' and app = 'phpgwapi' and location = 'config'",__LINE__,__FILE__);
@$this->db->query("DELETE FROM phpgw_app_sessions WHERE app = 'phpgwapi' and location = 'phpgw_info_cache'",__LINE__,__FILE__);
$this->db->unlock();
}
}
/*!
@function register_app
@abstract Add an application to the phpgw_applications table
@ -268,6 +290,7 @@
. "'" . $tables . "',"
. "'" . $setup_info[$appname]['version'] . "');"
);
$this->clear_session_cache();
}
}
@ -435,6 +458,7 @@
//echo 'DELETING application: ' . $appname;
$this->db->query("DELETE FROM $appstbl WHERE app_name='". $appname ."'");
$this->clear_session_cache();
}
/*!

View File

@ -66,19 +66,7 @@
$phpgw_setup->show_footer();
/* Add cleaning of app_sessions per skeeter, but with a check for the table being there, just in case */
$tablenames = @$phpgw_setup->db->table_names();
while(list($key,$val) = @each($tablenames))
{
$tables[] = $val['table_name'];
}
if ($phpgw_setup->isinarray('phpgw_app_sessions',$tables))
{
$phpgw_setup->db->lock(array('phpgw_app_sessions'));
@$phpgw_setup->db->query("DELETE FROM phpgw_app_sessions WHERE sessionid = '0' and loginid = '0' and app = 'phpgwapi' and location = 'config'",__LINE__,__FILE__);
@$phpgw_setup->db->query("DELETE FROM phpgw_app_sessions WHERE app = 'phpgwapi' and location = 'phpgw_info_cache'",__LINE__,__FILE__);
$phpgw_setup->db->unlock();
}
$phpgw_setup->clear_session_cache();
exit;
}