38 {
39 if (!is_dir($this->statdir)) {
40 throw new Exception('Statistics module: output dir do not exists [' . $this->statdir . ']');
41 }
42
43 if (!file_exists($this->inputfile)) {
44 throw new Exception('Statistics module: input file do not exists [' . $this->inputfile . ']');
45 }
46
47 $file = fopen($this->inputfile,
'r');
48
50 $this->statconfig->getValue('datestart', 0), $this->statconfig->getValue('datelength', 15), $this->statconfig->getValue('offsetspan', 44)
51 );
53
55 $sessioncounter = array();
56
58
59 while (!feof(
$file)) {
60 $logline = fgets(
$file, 4096);
61
62
63 if (!preg_match('/STAT/', $logline)) {
64 continue;
65 }
67
68
69 $epoch = $logparser->parseEpoch($logline);
70 $content = $logparser->parseContent($logline);
72
73 if ((
$i % 10000) == 0) {
74 echo(
"Read line " .
$i .
"\n");
75 }
76
77 $trackid = $content[4];
78
79 if (!isset($sessioncounter[$trackid])) {
80 $sessioncounter[$trackid] = 0;
81 }
82 $sessioncounter[$trackid]++;
83
85 echo("----------------------------------------\n");
86 echo('Log line: ' . $logline . "\n");
87 echo(
'Date parse [' . substr($logline, 0, $this->statconfig->getValue(
'datelength', 15)) .
'] to [' .
date(DATE_RFC822, $epoch) .
']' .
"\n");
88 echo htmlentities(print_r($content, true));
91 }
92 }
93 }
94
95 $histogram = array();
96 foreach ($sessioncounter as $trackid =>
$sc) {
97 if (!isset($histogram[
$sc])) {
99 }
101 }
102 ksort($histogram);
103
105 foreach ($sessioncounter as $trackid =>
$sc) {
108 }
109 }
110
112 }
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file