ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ 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
{
15
$name_underscore = str_replace(
'/'
,
'_'
,$tz_name);
16
17
if
(is_link(
ZONEINFO
.
'/'
.$tz_name))
18
{
19
$name = exec(
READLINK
.
' -f '
.
ZONEINFO
.
'/'
.$tz_name);
20
}
21
else
22
{
23
$name =
ZONEINFO
.
'/'
.$tz_name;
24
}
25
26
exec(
TZ_CONVERT
.
' -o Services/Calendar/zoneinfo/'
.$name_underscore.
'.tmp'
.
' '
.$name);
27
28
$reader
= fopen(
'Services/Calendar/zoneinfo/'
.$name_underscore.
'.tmp'
,
'r'
);
29
$writer = fopen(
'Services/Calendar/zoneinfo/'
.$name_underscore.
'.ics'
,
'w'
);
30
31
$counter
= 0;
32
while
($line = fgets(
$reader
))
33
{
34
if
(++
$counter
< 4)
35
{
36
continue
;
37
}
38
if
(
$counter
== 5)
39
{
40
fputs($writer,
'TZID:'
.$tz_name.
"\n"
);
41
}
42
else
43
{
44
if
(substr($line,0,13) ===
'END:VCALENDAR'
)
45
{
46
break
;
47
}
48
fputs($writer, $line);
49
}
50
}
51
52
fclose(
$reader
);
53
fclose($writer);
54
unlink(
'Services/Calendar/zoneinfo/'
.$name_underscore.
'.tmp'
);
55
56
#echo $name_underscore.' <br />';
57
}
58
59
60
?>
$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:301
READLINK
const READLINK
Definition:
zoneinfo_generator.php:6
$counter
$counter
Definition:
config-scanner.php:59
php
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 Fri Aug 29 2025 19:01:07 for ILIAS by
1.8.13 (using
Doxyfile
)