ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
zoneinfo_generator.php
Go to the documentation of this file.
1
<?php
2
exit
;
3
4
define(
'ZONEINFO'
,
'/usr/share/zoneinfo'
);
5
define(
'TZ_CONVERT'
,
'tz_convert'
);
6
define(
'READLINK'
,
'readlink'
);
7
8
chdir(
'../../..'
);
9
10
include_once(
'include/inc.header.php'
);
11
include_once(
'Services/Calendar/classes/class.ilCalendarUtil.php'
);
12
13
foreach
(
ilCalendarUtil::_getShortTimeZoneList
() as $tz_name => $tmp) {
14
$name_underscore = str_replace(
'/'
,
'_'
, $tz_name);
15
16
if
(is_link(
ZONEINFO
.
'/'
. $tz_name)) {
17
$name
= exec(
READLINK
.
' -f '
.
ZONEINFO
.
'/'
. $tz_name);
18
}
else
{
19
$name
=
ZONEINFO
.
'/'
. $tz_name;
20
}
21
22
exec(
TZ_CONVERT
.
' -o Services/Calendar/zoneinfo/'
. $name_underscore .
'.tmp'
.
' '
.
$name
);
23
24
$reader
= fopen(
'Services/Calendar/zoneinfo/'
. $name_underscore .
'.tmp'
,
'r'
);
25
$writer = fopen(
'Services/Calendar/zoneinfo/'
. $name_underscore .
'.ics'
,
'w'
);
26
27
$counter
= 0;
28
while
($line = fgets(
$reader
)) {
29
if
(++
$counter
< 4) {
30
continue
;
31
}
32
if
(
$counter
== 5) {
33
fputs($writer,
'TZID:'
. $tz_name .
"\n"
);
34
}
else
{
35
if
(substr($line, 0, 13) ===
'END:VCALENDAR'
) {
36
break
;
37
}
38
fputs($writer, $line);
39
}
40
}
41
42
fclose(
$reader
);
43
fclose($writer);
44
unlink(
'Services/Calendar/zoneinfo/'
. $name_underscore .
'.tmp'
);
45
46
#echo $name_underscore.' <br />';
47
}
$reader
$reader
Definition:
scanCallStructure.php:5
ZONEINFO
const ZONEINFO
Definition:
zoneinfo_generator.php:4
ilCalendarUtil\_getShortTimeZoneList
static _getShortTimeZoneList()
get short timezone list
Definition:
class.ilCalendarUtil.php:312
READLINK
const READLINK
Definition:
zoneinfo_generator.php:6
$counter
$counter
Definition:
config-scanner.php:59
$name
if($format !==null) $name
Definition:
metadata.php:146
TZ_CONVERT
const TZ_CONVERT
Definition:
zoneinfo_generator.php:5
exit
exit
Definition:
zoneinfo_generator.php:2
Services
Calendar
zoneinfo
zoneinfo_generator.php
Generated on Tue Jan 28 2025 19:01:30 for ILIAS by
1.8.13 (using
Doxyfile
)