75 if (!is_dir($this->statdir)) {
76 throw new Exception(
'Statistics module: output dir do not exists [' . $this->statdir .
']');
79 if (!file_exists($this->inputfile)) {
80 throw new Exception(
'Statistics module: input file do not exists [' . $this->inputfile .
']');
83 $file = fopen($this->inputfile,
'r');
85 if (
$file ===
false) {
86 throw new Exception(
'Statistics module: unable to open file [' . $this->inputfile .
']');
90 $this->statconfig->getValue(
'datestart', 0), $this->statconfig->getValue(
'datelength', 15), $this->statconfig->getValue(
'offsetspan', 44)
101 if (isset($this->metadata)) {
102 $notBefore = $this->metadata[
'notBefore'];
103 $lastlinehash = $this->metadata[
'lastlinehash'];
106 $lastlogline =
'sdfsdf';
107 $lastlineflip =
false;
112 while (!feof(
$file)) {
113 $logline = fgets(
$file, 4096);
116 if (!preg_match(
'/STAT/', $logline)) {
121 $lastlogline = $logline;
124 $epoch = $logparser->parseEpoch($logline);
125 $content = $logparser->parseContent($logline);
128 if ($this->fromcmdline && (
$i % 10000) == 0) {
129 echo(
"Read line " .
$i .
"\n");
133 echo(
"----------------------------------------\n");
134 echo(
'Log line: ' . $logline .
"\n");
135 echo(
'Date parse [' . substr($logline, 0, $this->statconfig->getValue(
'datelength', 15)) .
'] to [' .
date(DATE_RFC822, $epoch) .
']' .
"\n");
136 echo htmlentities(print_r($content,
true));
142 if ($epoch > $lastRead) {
146 if ($epoch === $notBefore) {
147 if (!$lastlineflip) {
148 if (sha1($logline) === $lastlinehash) {
149 $lastlineflip =
true;
155 if ($epoch < $notBefore) {
160 foreach ($this->statrules as $rulename =>
$rule) {
163 if (array_key_exists(
'type',
$rule)) {
167 if (
$type !==
'aggregate') {
171 foreach ($this->timeres AS $tres => $tresconfig ) {
173 if (isset($tresconfig[
'customDateHandler'])) {
174 $dh = $tresconfig[
'customDateHandler'];
177 $timeslot = $datehandler[
'default']->toSlot($epoch, $tresconfig[
'slot']);
178 $fileslot = $datehandler[$dh]->toSlot($epoch, $tresconfig[
'fileslot']);
184 $difcol = self::getDifCol($content,
$rule[
'col']);
198 $this->metadata[
'notBefore'] = $lastRead;
199 $this->metadata[
'lastline'] = $lastlogline;
200 $this->metadata[
'lastlinehash'] = sha1($lastlogline);
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Create styles array
The data for the language used.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file