root/dev/common/admin/option_acache.php @ 317

Revision 317, 1.3 KB (checked in by ralle030583, 14 years ago)

- ADD (TEST) api class for testing, getCharId from eve, atm commented out
- fixes for Tickets #74,#75,#77
- DBUpdate004: trinity ships had wrong tech level
- mailer should now send the killmail per email instead of msg that is classified
- and fixed the version in readme cause of the confusion ;-)

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('Disabling threshold', 'reinforced_disable_threshold', 'edit:size:4');
18options::fadd('Reinforcement chance', 'reinforced_prob', 'edit:size:4');
19options::fadd('Reinforcement end chance', 'reinforced_rf_prob', 'edit:size:4');
20
21class admin_acache
22{
23    function showLoad()
24    {
25        $load = @file_get_contents('/proc/loadavg');
26        if (false === $load)
27        {
28            return "Your web host does not allow access to the load metric. Reinforced mode will not work.";
29        }
30        else
31        {
32            $array = explode(' ', $load);
33            return (float)$array[0];
34        }
35    }
36}
37?>
Note: See TracBrowser for help on using the browser.