//TODO: Accelerator cache keys, removed scripts (stats here and a class to manage them (we'd probably never use it, but I like completeness))
//INFO: http://bart.eaccelerator.net/doc/phpdoc/
//INFO: http://bakery.cakephp.org/articles/view/eaccelerator-cache-engine - pertains to potential todo for eAccelerator cache class
if (!check_perms('site_debug')) {
error(403);
}
if (!extension_loaded('eAccelerator')) {
error('eAccelerator Extension not loaded.');
}
if (isset($_POST['submit'])) {
if ($_POST['cache'] == 1) {
authorize();
eaccelerator_caching(true);
} else {
eaccelerator_caching(false);
}
if (function_exists('eaccelerator_optimizer')) {
if ($_POST['optimize'] == 1) {
authorize();
eaccelerator_optimizer(true);
} else {
eaccelerator_optimizer(false);
}
}
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();
View::show_header("Opcode Stats");
?>
Status |
Total Storage: |
=Format::get_size($Opcode['memorySize'])?> |
Used Storage: |
=Format::get_size($Opcode['memoryAllocated'])?> (=number_format(($Opcode['memoryAllocated'] / $Opcode['memorySize']) * 100, 3);?>%) |
Free Storage: |
=Format::get_size($Opcode['memoryAvailable'])?> (=number_format(($Opcode['memoryAvailable'] / $Opcode['memorySize']) * 100, 3);?>%) |
Cached Scripts: |
=number_format($Opcode['cachedScripts'])?> |
Removed Scripts: |
=number_format($Opcode['removedScripts'])?> |
Cached Keys: |
if (function_exists('eaccelerator_get')) { ?>
=number_format($Opcode['cachedKeys'])?> |
} else { ?>
N/A |
} ?>
File Path |
Age |
Size |
Hits |
if (count($CachedScripts) == 0) { // Uh-oh, try again.
echo 'No scripts cached. |
';
}
$Row = 'a'; // For the pretty colours
foreach ($CachedScripts as $Script) {
list($FilePath, $Modified, $Size, $Reloads, $Uses, $Hits) = array_values($Script);
$Row = ($Row == 'a') ? 'b' : 'a';
?>
=$FilePath?> |
=time_diff($Modified)?> |
=Format::get_size($Size)?> |
=number_format($Hits)?> |
}
?>
View::show_footer(); ?>