Changeset 1074 for trunk/htdocs/cacher/index.php
- Timestamp:
- 2012-07-29T07:06:57+02:00 (10 months ago)
- File:
-
- 1 moved
-
trunk/htdocs/cacher/index.php (moved) (moved from trunk/htdocs/cacher/cacher.php) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/htdocs/cacher/index.php
r1069 r1074 114 114 } 115 115 return implode('', $html); 116 } 117 118 function getModuleInfo() 119 { 120 ob_start(); 121 phpinfo(INFO_MODULES); 122 $moduleInfo = ob_get_clean(); 123 if (!preg_match_all('!(XCache[^<>]*)</a></h2>(.*?)<h2>!is', $moduleInfo, $m)) { 124 return; 125 } 126 127 $moduleInfo = array(); 128 foreach ($m[1] as $i => $dummy) { 129 $moduleInfo[] = '<h3>' . trim($m[1][$i]) . '</h3>'; 130 $moduleInfo[] = str_replace('<br />', '', trim($m[2][$i])); 131 } 132 return implode('', $moduleInfo); 116 133 } 117 134 … … 156 173 } 157 174 158 $moduleinfo = null; 159 $type_none = -1; 160 if (!isset($_GET['type'])) { 161 $_GET['type'] = $type_none; 162 } 163 $_GET['type'] = $type = (int) $_GET['type']; 175 $listTypes = array('' => _('Summary'), 'listphp' => _('List PHP'), 'listvar' => _('List Var Data')); 176 177 if (!isset($_GET['do'])) { 178 $_GET['do'] = ''; 179 } 164 180 165 181 // {{{ process clear, enable, disable … … 194 210 for ($i = 0; $i < $pcnt; $i ++) { 195 211 $data = xcache_info(XC_TYPE_PHP, $i); 196 if ($ type === XC_TYPE_PHP) {212 if ($_GET['do'] === 'listphp') { 197 213 $data += xcache_list(XC_TYPE_PHP, $i); 198 214 } … … 220 236 for ($i = 0; $i < $vcnt; $i ++) { 221 237 $data = xcache_info(XC_TYPE_VAR, $i); 222 if ($ type === XC_TYPE_VAR) {238 if ($_GET['do'] === 'listvar') { 223 239 $data += xcache_list(XC_TYPE_VAR, $i); 224 240 } … … 243 259 // }}} 244 260 // {{{ merge the list 245 switch ($type) { 246 case XC_TYPE_PHP: 247 case XC_TYPE_VAR: 248 $cachelist = array('type' => $type, 'cache_list' => array(), 'deleted_list' => array()); 249 if ($type == XC_TYPE_VAR) { 261 switch ($_GET['do']) { 262 case 'listphp': 263 case 'listvar': 264 $cachelist = array('cache_list' => array(), 'deleted_list' => array()); 265 if ($_GET['do'] == 'listphp') { 266 $cachelist['type_name'] = 'php'; 267 $cachelist['type'] = XC_TYPE_PHP; 268 } 269 else { 250 270 $cachelist['type_name'] = 'var'; 251 } 252 else { 253 $cachelist['type_name'] = 'php'; 271 $cachelist['type'] = XC_TYPE_VAR; 254 272 } 255 273 foreach ($cacheinfos as $i => $c) { … … 257 275 continue; 258 276 } 259 if ($c['type'] == $ type&& isset($c['cache_list'])) {277 if ($c['type'] == $cachelist['type'] && isset($c['cache_list'])) { 260 278 foreach ($c['cache_list'] as $e) { 261 279 $e['cache_name'] = $c['cache_name']; … … 268 286 } 269 287 } 270 if ($ type== XC_TYPE_PHP) {288 if ($cachelist['type'] == XC_TYPE_PHP) { 271 289 $inodes = array(); 272 290 $haveinode = false; … … 287 305 } 288 306 unset($data); 307 include("./listentries.tpl.php"); 289 308 break; 290 309 291 310 default: 292 $_GET['type'] = $type_none; 293 $cachelist = array(); 294 ob_start(); 295 phpinfo(INFO_MODULES); 296 $moduleinfo = ob_get_clean(); 297 if (preg_match_all('!(XCache[^<>]*)</a></h2>(.*?)<h2>!is', $moduleinfo, $m)) { 298 $moduleinfo = array(); 299 foreach ($m[1] as $i => $dummy) { 300 $moduleinfo[] = '<h3>' . trim($m[1][$i]) . '</h3>'; 301 $moduleinfo[] = str_replace('<br />', '', trim($m[2][$i])); 302 } 303 $moduleinfo = implode('', $moduleinfo); 304 } 305 else { 306 $moduleinfo = null; 307 } 308 break; 311 include("./summary.tpl.php"); 309 312 } 310 313 // }}} 311 314 312 $type_php = XC_TYPE_PHP;313 $type_var = XC_TYPE_VAR;314 $listTypes = array($type_none => _('Statistics'), $type_php => _('List PHP'), $type_var => _('List Var Data'));315 316 include("cacher.tpl.php");317 318 315 ?>
Note: See TracChangeset
for help on using the changeset viewer.

