mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-05-03 12:02:51 +02:00
Delete caches and optimize tables on upgrade
git-svn-id: http://piwigo.org/svn/trunk@2890 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -1762,12 +1762,24 @@ function pwg_URL()
|
||||
/**
|
||||
* Invalidates cahed data (permissions and category counts) for all users.
|
||||
*/
|
||||
function invalidate_user_cache()
|
||||
function invalidate_user_cache($full = true)
|
||||
{
|
||||
$query = '
|
||||
if ($full)
|
||||
{
|
||||
$query = '
|
||||
TRUNCATE TABLE '.USER_CACHE_CATEGORIES_TABLE.';';
|
||||
pwg_query($query);
|
||||
$query = '
|
||||
TRUNCATE TABLE '.USER_CACHE_TABLE.';';
|
||||
pwg_query($query);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query = '
|
||||
UPDATE '.USER_CACHE_TABLE.'
|
||||
SET need_update = \'true\'';
|
||||
pwg_query($query);
|
||||
SET need_update = \'true\';';
|
||||
pwg_query($query);
|
||||
}
|
||||
trigger_action('invalidate_user_cache');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user