root/branch/rev3/common/admin/option_acache.php @ 243

Revision 243, 1.0 KB (checked in by exi, 13 years ago)

Moving config to runtime
Added reinforced management
New icon set with alpha, fixed missing/wrong icons
Changed version to 1.4.0
Added code for handling the new dogma codebase

Line 
1<?php
2/*
3* This file contains the generic admin options in the new format
4* look here for some examples.
5*/
6
7options::cat('Advanced', 'Cache', 'Cache Control');
8options::fadd('Caching enabled', 'cache_enabled', 'checkbox');
9options::fadd('Cache directory', 'cache_dir', 'edit:size:40');
10options::fadd('Ignore pages', 'cache_ignore', 'edit:size:60');
11options::fadd('Cache times', 'cache_times', 'edit:size:60');
12
13options::cat('Advanced', 'Cache', 'Reinforced');
14options::fadd('Enable Reinforced Management', 'auto_reinforced', 'checkbox');
15options::fadd('Current Load', 'none', 'custom', array('admin_acache', 'showLoad'));
16options::fadd('Reinforcement threshold', 'reinforced_threshold', 'edit:size:4');
17options::fadd('Reinforcement chance', 'reinforced_prob', 'edit:size:4');
18options::fadd('Reinforcement end chance', 'reinforced_rf_prob', 'edit:size:4');
19
20class admin_acache
21{
22    function showLoad()
23    {
24        $load = file_get_contents('/proc/loadavg');
25        $array = explode(' ', $load);
26        return (float)$array[0];
27    }
28}
29?>
Note: See TracBrowser for help on using the browser.