Ignore:
Timestamp:
Nov 19, 2008, 9:03:49 PM (15 years ago)
Author:
rub
Message:

Delete caches and optimize tables on upgrade

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions.php

    r2882 r2890  
    17631763 * Invalidates cahed data (permissions and category counts) for all users.
    17641764 */
    1765 function invalidate_user_cache()
    1766 {
    1767   $query = '
     1765function invalidate_user_cache($full = true)
     1766{
     1767  if ($full)
     1768  {
     1769    $query = '
     1770TRUNCATE TABLE '.USER_CACHE_CATEGORIES_TABLE.';';
     1771    pwg_query($query);
     1772    $query = '
     1773TRUNCATE TABLE '.USER_CACHE_TABLE.';';
     1774    pwg_query($query);
     1775  }
     1776  else
     1777  {
     1778    $query = '
    17681779UPDATE '.USER_CACHE_TABLE.'
    1769   SET need_update = \'true\'';
    1770   pwg_query($query);
     1780  SET need_update = \'true\';';
     1781    pwg_query($query);
     1782  }
    17711783  trigger_action('invalidate_user_cache');
    17721784}
Note: See TracChangeset for help on using the changeset viewer.