ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
sspmod_statistics_LogParser Class Reference
+ Collaboration diagram for sspmod_statistics_LogParser:

Public Member Functions

 __construct ($datestart, $datelength, $offset)
 Constructor. More...
 
 parseEpoch ($line)
 
 parseContent ($line)
 

Private Attributes

 $datestart
 
 $datelength
 
 $offset
 

Detailed Description

Definition at line 6 of file LogParser.php.

Constructor & Destructor Documentation

◆ __construct()

sspmod_statistics_LogParser::__construct (   $datestart,
  $datelength,
  $offset 
)

Constructor.

Parameters
integer$datestartAt which char is the date starting
integer$datelengthHow many characters is the date (on the b
integer$offsetAt which char is the rest of the entries starting

Definition at line 30 of file LogParser.php.

31 {
32 $this->datestart = $datestart;
33 $this->datelength = $datelength;
34 $this->offset = $offset;
35 }

References $datelength, $datestart, and $offset.

Member Function Documentation

◆ parseContent()

sspmod_statistics_LogParser::parseContent (   $line)
Parameters
string$line
Returns
array

Definition at line 69 of file LogParser.php.

70 {
71 $contentstr = substr($line, $this->offset);
72 $content = explode(' ', $contentstr);
73 return $content;
74 }

◆ parseEpoch()

sspmod_statistics_LogParser::parseEpoch (   $line)
Parameters
string$line
Returns
integer

Definition at line 43 of file LogParser.php.

44 {
45 $epoch = strtotime(substr($line, 0, $this->datelength));
46 if ($epoch > time() + 2678400) { // 60 * 60 *24 * 31 = 2678400
47 /*
48 * More than a month in the future - probably caused by
49 * the log files missing the year.
50 * We will therefore subtrackt one year.
51 */
52 $hour = gmdate('H', $epoch);
53 $minute = gmdate('i', $epoch);
54 $second = gmdate('s', $epoch);
55 $month = gmdate('n', $epoch);
56 $day = gmdate('j', $epoch);
57 $year = gmdate('Y', $epoch) - 1;
58 $epoch = gmmktime($hour, $minute, $second, $month, $day, $year);
59 }
60 return $epoch;
61 }

Field Documentation

◆ $datelength

sspmod_statistics_LogParser::$datelength
private

Definition at line 16 of file LogParser.php.

Referenced by __construct().

◆ $datestart

sspmod_statistics_LogParser::$datestart
private

Definition at line 11 of file LogParser.php.

Referenced by __construct().

◆ $offset

sspmod_statistics_LogParser::$offset
private

Definition at line 21 of file LogParser.php.

Referenced by __construct().


The documentation for this class was generated from the following file: