Changeset 12820 for trunk/admin/include/functions.php
- Timestamp:
- Jan 1, 2012, 10:10:43 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r12797 r12820 2055 2055 2056 2056 case 'configuration': 2057 case 'derivatives': 2057 2058 case 'extend_for_templates': 2058 2059 case 'menubar': … … 2248 2249 } 2249 2250 2250 function clear_derivative_cache($type='all') 2251 /** delete all derivative files for one or several types */ 2252 function clear_derivative_cache($types='all') 2251 2253 { 2252 2254 $pattern='#.*-'; 2253 if ($type == 'all') 2255 if ($types == 'all') 2256 { 2257 $types = ImageStdParams::get_all_types(); 2258 $types[] = IMG_CUSTOM; 2259 } 2260 elseif (!is_array($types)) 2261 { 2262 $types = array($types); 2263 } 2264 2265 if (count($types)>1) 2254 2266 { 2255 2267 $type_urls = array(); 2256 foreach( ImageStdParams::get_all_types()as $dtype)2268 foreach($types as $dtype) 2257 2269 { 2258 2270 $type_urls[] = derivative_to_url($dtype); 2259 2271 } 2260 $type_urls[] = derivative_to_url(IMG_CUSTOM);2261 2272 $pattern .= '(' . implode('|',$type_urls) . ')'; 2262 2273 } 2263 2274 else 2264 2275 { 2265 $pattern .= derivative_to_url($type); 2266 } 2276 $pattern .= derivative_to_url($types[0]); 2277 } 2278 2267 2279 $pattern.='(_[a-zA-Z0-9]+)*\.[a-zA-Z0-9]{3,4}$#'; 2268 2280 if ($contents = opendir(PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR)) … … 2321 2333 } 2322 2334 clearstatcache(); 2323 rmdir($path);2335 @rmdir($path); 2324 2336 } 2325 2337 return $rmdir;
Note: See TracChangeset
for help on using the changeset viewer.