24 $statdir = $this->statconfig->getValue(
'statdir');
25 $inputfile = $this->statconfig->getValue(
'inputfile');
26 $statrules = $this->statconfig->getValue(
'statrules');
27 $timeres = $this->statconfig->getValue(
'timeres');
32 if (!is_dir($statdir)) {
33 throw new Exception(
'Statisics output directory [' . $statdir .
'] does not exists.');
35 $filelist = scandir($statdir);
36 $this->available =
array();
37 foreach ($filelist as
$file) {
38 if (preg_match(
'/([a-z0-9_]+)-([a-z0-9_]+)-([0-9]+)\.stat/', $file, $matches)) {
39 if (array_key_exists($matches[1], $statrules)) {
40 if (array_key_exists($matches[2],
$timeres))
41 $this->available[$matches[1]][$matches[2]][] = $matches[3];
45 if (empty($this->available)) {
46 throw new Exception(
'No aggregated statistics files found in [' . $statdir .
']');
52 $this->availrules = array_keys($statrules);
53 $available_rules =
array();
54 foreach ($this->availrules as
$key) {
55 $available_rules[
$key] =
array(
'name' => $statrules[$key][
'name'],
'descr' => $statrules[$key][
'descr']);
57 $this->availrulenames = $available_rules;
75 $rule = $this->statconfig->getString(
'default', $this->availrules[0]);
77 if (in_array(
$preferRule, $this->availrules,
true)) {
87 $statrulesConfig = $this->statconfig->getConfigItem(
'statrules');
88 $statruleConfig = $statrulesConfig->getConfigItem(
$rule);
91 $statrule =
new $presenterClass($this->statconfig, $statruleConfig,
$rule, $this->available);
Create styles array
The data for the language used.
__construct($statconfig)
Constructor.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static resolveClass($id, $type, $subclass=null)
Resolve module class.
resolveSelectedRule($preferRule=null)
Resolve which rule is selected.