Changeset 12758


Ignore:
Timestamp:
12/17/11 19:14:43 (8 years ago)
Author:
patdenice
Message:

Delete cache automaticaly if height or margin has changed

Location:
extensions/GThumb
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/GThumb/admin.php

    r12733 r12758  
    7070  } 
    7171 
     72  if ($params['height'] != $conf['GThumb']['height']) 
     73  { 
     74    gtdeltree(GTHUMB_CACHE_DIR); 
     75  } 
     76  elseif ($params['margin'] != $conf['GThumb']['margin']) 
     77  { 
     78    gtdeltree(GTHUMB_CACHE_DIR.'/'.($conf['GThumb']['height'] * 2 + $conf['GThumb']['margin'])); 
     79  } 
     80 
    7281  if (empty($page['errors'])) 
    7382  { 
  • extensions/GThumb/main.inc.php

    r12751 r12758  
    3939  $user['nb_image_page'] = $conf['GThumb']['nb_image_page']; 
    4040  $page['nb_image_page'] = $conf['GThumb']['nb_image_page']; 
    41  
    42   if (is_dir(GTHUMB_CACHE_DIR) and !is_dir(GTHUMB_CACHE_DIR.'/'.$conf['GThumb']['height'])) 
    43   { 
    44     // We clean cache dir because configuration has changed 
    45     include_once(GTHUMB_PATH.'functions.inc.php'); 
    46     gtdeltree(GTHUMB_CACHE_DIR); 
    47   } 
    4841} 
    4942 
  • extensions/GThumb/maintain.inc.php

    r12705 r12758  
    1616{ 
    1717  include_once(dirname(__FILE__).'/functions.inc.php'); 
    18   gtdeltree(GTHUMB_CACHE_DIR); 
     18  gtdeltree(PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'GThumb'); 
    1919   
    2020  $query = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="GThumb" LIMIT 1;'; 
Note: See TracChangeset for help on using the changeset viewer.