Changeset 521 for trunk/admin/xcache.php
- Timestamp:
- 02/17/2008 02:27:05 PM (10 months ago)
- Files:
-
- 1 modified
-
trunk/admin/xcache.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/xcache.php
r520 r521 169 169 $cacheid = (int) (isset($_POST['cacheid']) ? $_POST['cacheid'] : 0); 170 170 if (isset($_POST['clearcache'])) { 171 xcache_clear_cache($type, $cacheid); 171 $count = xcache_count($type); 172 if ($cacheid == $count) { 173 for ($cacheid = 0; $cacheid < $count; $cacheid ++) { 174 xcache_clear_cache($type, $cacheid); 175 } 176 } 177 else { 178 xcache_clear_cache($type, $cacheid); 179 } 172 180 } 173 181 } … … 177 185 // {{{ load info/list 178 186 $cacheinfos = array(); 187 $total = array(); 179 188 for ($i = 0; $i < $pcnt; $i ++) { 180 189 $data = xcache_info(XC_TYPE_PHP, $i); … … 186 195 $data['cacheid'] = $i; 187 196 $cacheinfos[] = $data; 188 } 197 if ($pcnt >= 2) { 198 foreach ($data as $k => $v) { 199 switch ($k) { 200 case 'type': 201 case 'cache_name': 202 case 'cacheid': 203 case 'free_blocks': 204 continue 2; 205 } 206 if (!isset($total[$k])) { 207 $total[$k] = $v; 208 } 209 else { 210 $total[$k] += $v; 211 } 212 } 213 } 214 } 215 216 if ($pcnt >= 2) { 217 $total['type'] = XC_TYPE_PHP; 218 $total['cache_name'] = _T('Total'); 219 $total['cacheid'] = $pcnt; 220 $total['gc'] = null; 221 $total['istotal'] = true; 222 $cacheinfos[] = $total; 223 } 224 225 $total = array(); 189 226 for ($i = 0; $i < $vcnt; $i ++) { 190 227 $data = xcache_info(XC_TYPE_VAR, $i); … … 196 233 $data['cacheid'] = $i; 197 234 $cacheinfos[] = $data; 235 if ($pcnt >= 2) { 236 foreach ($data as $k => $v) { 237 switch ($k) { 238 case 'type': 239 case 'cache_name': 240 case 'cacheid': 241 case 'free_blocks': 242 case 'gc': 243 continue 2; 244 } 245 if (!isset($total[$k])) { 246 $total[$k] = $v; 247 } 248 else { 249 $total[$k] += $v; 250 } 251 } 252 } 253 } 254 255 if ($vcnt >= 2) { 256 $total['type'] = XC_TYPE_VAR; 257 $total['cache_name'] = _T('Total'); 258 $total['cacheid'] = $vcnt; 259 $total['gc'] = null; 260 $total['istotal'] = true; 261 $cacheinfos[] = $total; 198 262 } 199 263 // }}} … … 210 274 } 211 275 foreach ($cacheinfos as $i => $c) { 276 if (!empty($c['istotal'])) { 277 continue; 278 } 212 279 if ($c['type'] == $type && isset($c['cache_list'])) { 213 280 foreach ($c['cache_list'] as $e) {

