function eaccelerator_display($mode, $start = 0, $limit = 5, $sort = false) { global $_CLASS, $sort_by; $total_count = 0; switch ($mode) { case 'scripts': case 'removed_scripts': $scripts_array = $mode === 'scripts' ? eaccelerator_cached_scripts() : eaccelerator_removed_scripts(); if (!empty($scripts_array)) { $sort_by = 'mtime'; usort($scripts_array, 'eaccelerator_compare'); $total_count = count($scripts_array); $end = min($start + $limit, $total_count); for ($i = $start; $i < $end; $i++) { $scripts_array[$i]['time'] = date('Y/m/d H:i', $scripts_array[$i]['mtime']); $scripts_array[$i]['size'] = generate_size($scripts_array[$i]['size']); $_CLASS['core_template']->assign_vars_array($mode . '_array', $scripts_array[$i]); } } break; case 'keys': $keys_array = eaccelerator_list_keys(); if (!empty($keys_array)) { $sort_by = 'created'; usort($keys_array, 'eaccelerator_compare'); $total_count = count($keys_array); $end = min($start + $limit, $total_count); for ($i = $start; $i < $end; $i++) { $keys_array[$i]['created'] = date('Y/m/d H:i', $keys_array[$i]['created']); $keys_array[$i]['size'] = generate_size($keys_array[$i]['size']); if ($keys_array[$i]['ttl'] == 0) { $keys_array[$i]['expire_time'] = 'none'; } elseif ($keys_array[$i]['ttl'] == -1) { $keys_array[$i]['expire_time'] = 'expired'; } else { $keys_array[$i]['expire_time'] = date('Y/m/d H:i', $keys_array[$i]['ttl']); } $_CLASS['core_template']->assign_vars_array('keys_array', $keys_array[$i]); } } break; } $pagination = generate_pagination('eaccelerator&mode=' . $mode, $total_count, $limit, $start, true); $_CLASS['core_template']->assign_array(array($mode . '_more' => $total_count < $limit ? false : true, $mode . '_pagination' => $pagination['formated'], $mode . '_pagination_array' => $pagination['array'])); }
public function info() { $info = array(); $info['info'] = eaccelerator_info(); $info['keys'] = eaccelerator_list_keys(); $info['script'] = eaccelerator_cached_scripts(); $info['script_remove'] = eaccelerator_removed_scripts(); return $info; }
</tr> <tr> <td class="e">Clean cache</td> <td><input type="submit" name="clean" value="clean" title=" remove all expired scripts and data from shared memory and disk cache" /></td> </tr> <tr> <td class="e">Purge cache</td> <td><input type="submit" name="purge" value="purge" title="remove all 'removed' scripts from shared memory" /></td> </tr> </table> </form> <!-- }}} --> <h2>Cached scripts</h2> <?php create_script_table(eaccelerator_cached_scripts()); ?> <h2>Removed scripts</h2> <?php create_script_table(eaccelerator_removed_scripts()); ?> <?php if (function_exists('eaccelerator_get')) { echo "<h2>Cached keys</h2>"; create_key_table(eaccelerator_list_keys()); } ?> <!-- {{{ footer -->
} if (isset($_POST['clear'])) { authorize(); eaccelerator_clear(); } if (isset($_POST['clean'])) { authorize(); eaccelerator_clean(); } if (isset($_POST['purge'])) { authorize(); eaccelerator_purge(); } } $Opcode = eaccelerator_info(); $CachedScripts = eaccelerator_cached_scripts(); //$RemovedScripts = eaccelerator_removed_scripts(); show_header("Opcode Stats"); ?> <div class="thin"> <div> <form action="" method="post"> <div> <input type="hidden" name="action" value="opcode_stats" /> <input type="hidden" name="auth" value="<?php echo $LoggedUser['AuthKey']; ?> " /> </div> <table cellpadding="6" cellspacing="1" border="0" class="border" width="100%"> <tr>
print '<td>Cached scripts</td>'; print '<td align="right">' . $info['cachedScripts'] . '</td>'; print '</tr>'; $var = !$var; print '<tr ' . $bc[$var] . '>'; print '<td>Removed scripts</td>'; print '<td align="right">' . $info['removedScripts'] . '</td>'; print '</tr>'; $var = !$var; print '<tr ' . $bc[$var] . '>'; print '<td>Cached keys</td>'; print '<td align="right">' . (isset($info['cachedKeys']) ? $info['cachedKeys'] : '') . '</td>'; print '</tr>'; print '</table>'; $var = true; $resCached = @eaccelerator_cached_scripts(); // If success return an array $resRemoved = @eaccelerator_removed_scripts(); if (is_array($resCached) || is_array($resRemoved)) { print "<br>"; print '<form name="ea_control" method="post">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<table class="noborder">'; print '<tr class="liste_titre"><td colspan="2">Actions</td></tr>'; if (is_array($resCached)) { $var = !$var; print "<tr " . $bc[$var] . ">"; print "<td>Caching</td>"; print '<td align="right"><input type="submit" class="butAction" name="caching" value="' . ($info['cache'] ? 'disable' : 'enable') . '" /></td>'; print "</tr>"; $var = !$var;
<td align="right"><?php print $info['cachedScripts']; ?></td> </tr> <tr <?php $var = ! $var; print $bc[$var]; ?>> <td>Removed scripts</td> <td align="right"><?php print $info['removedScripts']; ?></td> </tr> <tr <?php $var = ! $var; print $bc[$var]; ?>> <td>Cached keys</td> <td align="right"><?php print $info['cachedKeys']; ?></td> </tr> </table> <?php $var=true; $resCached = @eaccelerator_cached_scripts(); // If success return an array $resRemoved = @eaccelerator_removed_scripts(); if (is_array($resCached) || is_array($resRemoved)) { print "<br>"; print '<form name="ea_control" method="post">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<table class="noborder">'; print '<tr class="liste_titre"><td colspan="2">Actions</td></tr>'; if (is_array($resCached)) { $var = ! $var; print "<tr ".$bc[$var].">"; print "<td>Caching</td>";