1<?php 2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project 3// 4// All Rights Reserved. See copyright.txt for details and a complete list of authors. 5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. 6 7//this script may only be included - so its better to die if called directly. 8if (strpos($_SERVER['SCRIPT_NAME'], basename(__FILE__)) !== false) { 9 header('location: index.php'); 10 exit; 11} 12 13$opcode_stats = $adminlib->getOpcodeCacheStatus(); 14$stat_flag = $opcode_stats['stat_flag']; 15if ($stat_flag) { 16 $smarty->assign('stat_flag', $stat_flag); 17} 18 19$opcode_cache = $opcode_stats['opcode_cache']; 20$smarty->assign('opcode_cache', $opcode_cache); 21$smarty->assign('opcode_stats', $opcode_stats); 22$smarty->assign('opcode_compatible', $adminlib->checkOPCacheCompatibility()); 23 24$txtUsed = tr('Used'); 25$txtAvailable = tr('Available'); 26$smarty->assign( 27 'memory_graph', 28 ([ 29 'data' => $opcode_stats['memory_used'] . ':' . $opcode_stats['memory_avail'], 30 'data_labels' => $txtUsed . '|' . $txtAvailable, 31 ]) 32); 33 34$txtHit = tr('Hit'); 35$txtMiss = tr('Miss'); 36$smarty->assign( 37 'hits_graph', 38 ([ 39 'data' => $opcode_stats['hit_hit'] . ':' . $opcode_stats['hit_miss'], 40 'data_labels' => $txtHit . ':' . $txtMiss, 41 ]) 42); 43 44// realpath_cache_size can make considerable difference on php performance apparently 45if (function_exists('realpath_cache_size')) { 46 $rpcs_current = realpath_cache_size(); 47 $rpcs_ini = ini_get('realpath_cache_size'); 48 $rpc_ttl = ini_get('realpath_cache_ttl'); 49 $smarty->assign('realpath_cache_size_current', $rpcs_current); 50 $smarty->assign('realpath_cache_size_ini', $rpcs_ini); 51 $smarty->assign('realpath_cache_ttl', $rpc_ttl); 52 $smarty->assign('realpath_cache_size_percent', round($rpcs_current / TikiLib::lib('tiki')->return_bytes($rpcs_ini) * 100, 2)); 53} 54