@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $data = $dataset->getDebugData(); |
161 | 161 | foreach ($data as $de) { |
162 | 162 | if (isset($de[1])) { |
163 | - echo '"' . $de[0] . '",' . $de[1] . "\n"; |
|
163 | + echo '"'.$de[0].'",'.$de[1]."\n"; |
|
164 | 164 | } |
165 | 165 | } |
166 | 166 | exit; |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | } |
238 | 238 | } |
239 | 239 | if ($type === 'get') { |
240 | - return Module::getModuleURL("statistics/showstats.php") . '?' . http_build_query($vars, '', '&'); |
|
240 | + return Module::getModuleURL("statistics/showstats.php").'?'.http_build_query($vars, '', '&'); |
|
241 | 241 | } |
242 | 242 | return $vars; |
243 | 243 | } |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function dumpConfig(): void |
64 | 64 | { |
65 | - echo 'Statistics directory : ' . $this->statdir . "\n"; |
|
66 | - echo 'Input file : ' . $this->inputfile . "\n"; |
|
67 | - echo 'Offset : ' . $this->offset . "\n"; |
|
65 | + echo 'Statistics directory : '.$this->statdir."\n"; |
|
66 | + echo 'Input file : '.$this->inputfile."\n"; |
|
67 | + echo 'Offset : '.$this->offset."\n"; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | public function debugInfo(): void |
74 | 74 | { |
75 | 75 | // 1024*1024=1048576 |
76 | - echo 'Memory usage : ' . number_format(memory_get_usage() / 1048576, 2) . " MB\n"; |
|
76 | + echo 'Memory usage : '.number_format(memory_get_usage() / 1048576, 2)." MB\n"; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function loadMetadata(): void |
83 | 83 | { |
84 | - $filename = $this->statdir . '/.stat.metadata'; |
|
84 | + $filename = $this->statdir.'/.stat.metadata'; |
|
85 | 85 | $metadata = null; |
86 | 86 | if (file_exists($filename)) { |
87 | 87 | $metadata = unserialize(file_get_contents($filename)); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $this->metadata['memory'] = memory_get_usage(); |
108 | 108 | $this->metadata['lastrun'] = time(); |
109 | 109 | |
110 | - $filename = $this->statdir . '/.stat.metadata'; |
|
110 | + $filename = $this->statdir.'/.stat.metadata'; |
|
111 | 111 | file_put_contents($filename, serialize($this->metadata), LOCK_EX); |
112 | 112 | } |
113 | 113 | |
@@ -122,17 +122,17 @@ discard block |
||
122 | 122 | $this->loadMetadata(); |
123 | 123 | |
124 | 124 | if (!is_dir($this->statdir)) { |
125 | - throw new Exception('Statistics module: output dir does not exist [' . $this->statdir . ']'); |
|
125 | + throw new Exception('Statistics module: output dir does not exist ['.$this->statdir.']'); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | if (!file_exists($this->inputfile)) { |
129 | - throw new Exception('Statistics module: input file does not exist [' . $this->inputfile . ']'); |
|
129 | + throw new Exception('Statistics module: input file does not exist ['.$this->inputfile.']'); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | $file = fopen($this->inputfile, 'r'); |
133 | 133 | |
134 | 134 | if ($file === false) { |
135 | - throw new Exception('Statistics module: unable to open file [' . $this->inputfile . ']'); |
|
135 | + throw new Exception('Statistics module: unable to open file ['.$this->inputfile.']'); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | $logparser = new LogParser( |
@@ -177,14 +177,14 @@ discard block |
||
177 | 177 | $action = trim($content[5]); |
178 | 178 | |
179 | 179 | if ($this->fromcmdline && ($i % 10000) == 0) { |
180 | - echo "Read line " . $i . "\n"; |
|
180 | + echo "Read line ".$i."\n"; |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | if ($debug) { |
184 | 184 | echo "----------------------------------------\n"; |
185 | - echo 'Log line: ' . $logline . "\n"; |
|
186 | - echo 'Date parse [' . substr($logline, 0, $this->statconfig->getOptionalValue('datelength', 15)) . |
|
187 | - '] to [' . date(DATE_RFC822, $epoch) . ']' . "\n"; |
|
185 | + echo 'Log line: '.$logline."\n"; |
|
186 | + echo 'Date parse ['.substr($logline, 0, $this->statconfig->getOptionalValue('datelength', 15)). |
|
187 | + '] to ['.date(DATE_RFC822, $epoch).']'."\n"; |
|
188 | 188 | $ret = print_r($content, true); |
189 | 189 | echo htmlentities($ret); |
190 | 190 | if ($i >= 13) { |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | } |
356 | 356 | } |
357 | 357 | |
358 | - $filename = $this->statdir . '/' . $rulename . '-' . $tres . '-' . $fileno . '.stat'; |
|
358 | + $filename = $this->statdir.'/'.$rulename.'-'.$tres.'-'.$fileno.'.stat'; |
|
359 | 359 | if (file_exists($filename)) { |
360 | 360 | $previousData = unserialize(file_get_contents($filename)); |
361 | 361 | $filledresult = $this->cummulateData($previousData, $filledresult); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | $timeresconfig = $timeresconfigs->getConfigItem($timeres); |
75 | 75 | if ($timeresconfig === null) { |
76 | - throw new Error\ConfigurationError('Missing \'timeres.' . $timeres . '\' in module configuration.'); |
|
76 | + throw new Error\ConfigurationError('Missing \'timeres.'.$timeres.'\' in module configuration.'); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | $this->timeresconfig = $timeresconfig; |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | 'Statistics\FieldPresentation' |
358 | 358 | ); |
359 | 359 | if (!class_exists($classname)) { |
360 | - throw new Exception('Could not find field presentation plugin [' . $classname . ']: No class found'); |
|
360 | + throw new Exception('Could not find field presentation plugin ['.$classname.']: No class found'); |
|
361 | 361 | } |
362 | 362 | $presentationHandler = new $classname($availdelimiters, $fieldpresConfig->getValue('config'), $t); |
363 | 363 | |
@@ -399,17 +399,17 @@ discard block |
||
399 | 399 | $rules = $this->ruleid; |
400 | 400 | foreach ($rules as $rule) { |
401 | 401 | // Get file and extract results. |
402 | - $resultFileName = $statdir . '/' . $rule . '-' . $this->timeres . '-' . $this->fileslot . '.stat'; |
|
402 | + $resultFileName = $statdir.'/'.$rule.'-'.$this->timeres.'-'.$this->fileslot.'.stat'; |
|
403 | 403 | if (!file_exists($resultFileName)) { |
404 | - throw new Exception('Aggregated statitics file [' . $resultFileName . '] not found.'); |
|
404 | + throw new Exception('Aggregated statitics file ['.$resultFileName.'] not found.'); |
|
405 | 405 | } |
406 | 406 | if (!is_readable($resultFileName)) { |
407 | - throw new Exception('Could not read statitics file [' . $resultFileName . ']. Bad file permissions?'); |
|
407 | + throw new Exception('Could not read statitics file ['.$resultFileName.']. Bad file permissions?'); |
|
408 | 408 | } |
409 | 409 | $resultfile = file_get_contents($resultFileName); |
410 | 410 | $newres = unserialize($resultfile); |
411 | 411 | if (empty($newres)) { |
412 | - throw new Exception('Aggregated statistics in file [' . $resultFileName . '] was empty.'); |
|
412 | + throw new Exception('Aggregated statistics in file ['.$resultFileName.'] was empty.'); |
|
413 | 413 | } |
414 | 414 | $resarray[] = $newres; |
415 | 415 | } |