ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
LogParser.php
Go to the documentation of this file.
1
<?
php
2
/*
3
* @author Andreas Åkre Solberg <andreas.solberg@uninett.no>
4
* @package SimpleSAMLphp
5
*/
6
class
sspmod_statistics_LogParser
7
{
11
private
$datestart
;
12
16
private
$datelength
;
17
21
private
$offset
;
22
30
public
function
__construct
(
$datestart
,
$datelength
,
$offset
)
31
{
32
$this->datestart =
$datestart
;
33
$this->datelength =
$datelength
;
34
$this->offset =
$offset
;
35
}
36
37
43
public
function
parseEpoch
($line)
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
}
62
63
69
public
function
parseContent
($line)
70
{
71
$contentstr = substr($line, $this->offset);
72
$content = explode(
' '
, $contentstr);
73
return
$content;
74
}
75
}
sspmod_statistics_LogParser\parseEpoch
parseEpoch($line)
Definition:
LogParser.php:43
sspmod_statistics_LogParser\$datelength
$datelength
Definition:
LogParser.php:16
sspmod_statistics_LogParser\$offset
$offset
Definition:
LogParser.php:21
sspmod_statistics_LogParser\parseContent
parseContent($line)
Definition:
LogParser.php:69
sspmod_statistics_LogParser\$datestart
$datestart
Definition:
LogParser.php:11
sspmod_statistics_LogParser\__construct
__construct($datestart, $datelength, $offset)
Constructor.
Definition:
LogParser.php:30
php
sspmod_statistics_LogParser
Definition:
LogParser.php:6
libs
composer
vendor
simplesamlphp
simplesamlphp
modules
statistics
lib
LogParser.php
Generated on Thu Jan 16 2025 19:01:56 for ILIAS by
1.8.13 (using
Doxyfile
)