mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-29 01:09:10 +01:00
This will now clear system/user level cache when adding/deleting apps.
This commit is contained in:
parent
2f00aa1545
commit
1f4c69b108
@ -191,6 +191,28 @@
|
|||||||
return $major;
|
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
|
@function register_app
|
||||||
@abstract Add an application to the phpgw_applications table
|
@abstract Add an application to the phpgw_applications table
|
||||||
@ -268,6 +290,7 @@
|
|||||||
. "'" . $tables . "',"
|
. "'" . $tables . "',"
|
||||||
. "'" . $setup_info[$appname]['version'] . "');"
|
. "'" . $setup_info[$appname]['version'] . "');"
|
||||||
);
|
);
|
||||||
|
$this->clear_session_cache();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -435,6 +458,7 @@
|
|||||||
|
|
||||||
//echo 'DELETING application: ' . $appname;
|
//echo 'DELETING application: ' . $appname;
|
||||||
$this->db->query("DELETE FROM $appstbl WHERE app_name='". $appname ."'");
|
$this->db->query("DELETE FROM $appstbl WHERE app_name='". $appname ."'");
|
||||||
|
$this->clear_session_cache();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -66,19 +66,7 @@
|
|||||||
$phpgw_setup->show_footer();
|
$phpgw_setup->show_footer();
|
||||||
|
|
||||||
/* Add cleaning of app_sessions per skeeter, but with a check for the table being there, just in case */
|
/* 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();
|
$phpgw_setup->clear_session_cache();
|
||||||
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user