ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
sspmod_statistics_LogParser Class Reference
+ Collaboration diagram for sspmod_statistics_LogParser:

Public Member Functions

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

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
$datestartAt which char is the date starting
$datelengthHow many characters is the date (on the b
$offsetAt which char is the rest of the entries starting

Definition at line 19 of file LogParser.php.

20 {
21 $this->datestart = $datestart;
22 $this->datelength = $datelength;
23 $this->offset = $offset;
24 }

References $datelength, $datestart, and $offset.

Member Function Documentation

◆ parse15()

sspmod_statistics_LogParser::parse15 (   $str)

Definition at line 56 of file LogParser.php.

56 {
57 $di = date_parse($str);
58 $datestamp = mktime($di['hour'], $di['minute'], $di['second'], $di['month'], $di['day']);
59 return $datestamp;
60 }

◆ parse23()

sspmod_statistics_LogParser::parse23 (   $str)

Definition at line 62 of file LogParser.php.

62 {
63 $timestamp = strtotime($str);
64 return $timestamp;
65 }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81

References $timestamp.

◆ parseContent()

sspmod_statistics_LogParser::parseContent (   $line)

Definition at line 46 of file LogParser.php.

46 {
47 $contentstr = substr($line, $this->offset);
48 $content = explode(' ', $contentstr);
49 return $content;
50 }

◆ parseEpoch()

sspmod_statistics_LogParser::parseEpoch (   $line)

Definition at line 26 of file LogParser.php.

27 {
28 $epoch = strtotime(substr($line, 0, $this->datelength));
29 if ($epoch > time() + 2678400) { // 60 * 60 *24 * 31 = 2678400
30 /*
31 * More than a month in the future - probably caused by
32 * the log files missing the year.
33 * We will therefore subtrackt one year.
34 */
35 $hour = gmdate('H', $epoch);
36 $minute = gmdate('i', $epoch);
37 $second = gmdate('s', $epoch);
38 $month = gmdate('n', $epoch);
39 $day = gmdate('j', $epoch);
40 $year = gmdate('Y', $epoch) - 1;
41 $epoch = gmmktime($hour, $minute, $second, $month, $day, $year);
42 }
43 return $epoch;
44 }

Field Documentation

◆ $datelength

sspmod_statistics_LogParser::$datelength
private

Definition at line 9 of file LogParser.php.

Referenced by __construct().

◆ $datestart

sspmod_statistics_LogParser::$datestart
private

Definition at line 8 of file LogParser.php.

Referenced by __construct().

◆ $offset

sspmod_statistics_LogParser::$offset
private

Definition at line 10 of file LogParser.php.

Referenced by __construct().


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