-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtimezonedb.c
129 lines (113 loc) · 3.28 KB
/
timezonedb.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Derick Rethans <[email protected]> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "php.h"
#include "ext/standard/info.h"
#include "php_timezonedb.h"
#include "ext/date/php_date.h"
#define timezonedb_builtin timezonedb_external
#define timezonedb_idx_builtin timezonedb_idx_external
#define timelib_timezone_db_data_builtin timelib_timezone_db_data_external
#if PHP_VERSION_ID >= 50441 && PHP_VERSION_ID <= 50499
# define TIMELIB_SUPPORTS_V2DATA
#endif
#if PHP_VERSION_ID >= 50525 && PHP_VERSION_ID <= 50599
# define TIMELIB_SUPPORTS_V2DATA
#endif
#if PHP_VERSION_ID >= 50609 && PHP_VERSION_ID <= 50699
# define TIMELIB_SUPPORTS_V2DATA
#endif
#if PHP_VERSION_ID >= 70000
# define TIMELIB_SUPPORTS_V2DATA
#endif
#include "timezonedb.h"
/* {{{ timezonedb_functions[]
*/
zend_function_entry timezonedb_functions[] = {
{NULL, NULL, NULL}
};
/* }}} */
/* {{{ timezonedb dependencies */
#if ZEND_MODULE_API_NO >= 20050922
static const zend_module_dep timezonedb_module_deps[] = {
ZEND_MOD_REQUIRED("standard")
ZEND_MOD_REQUIRED("date")
{NULL, NULL, NULL}
};
#endif
/* }}} */
/* {{{ timezonedb_module_entry
*/
zend_module_entry timezonedb_module_entry = {
#if ZEND_MODULE_API_NO >= 20050922
STANDARD_MODULE_HEADER_EX, NULL,
timezonedb_module_deps,
#else
STANDARD_MODULE_HEADER,
#endif
"timezonedb",
timezonedb_functions,
PHP_MINIT(timezonedb),
NULL,
NULL,
NULL,
PHP_MINFO(timezonedb),
PHP_TIMEZONEDB_VERSION,
STANDARD_MODULE_PROPERTIES
};
/* }}} */
#ifdef COMPILE_DL_TIMEZONEDB
ZEND_GET_MODULE(timezonedb)
#endif
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(timezonedb)
{
php_date_set_tzdb(&timezonedb_external);
return SUCCESS;
}
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION(timezonedb)
{
return SUCCESS;
}
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(timezonedb)
{
timelib_tzdb *tzdb = &timezonedb_external;
php_info_print_table_start();
php_info_print_table_row(2, "Alternative Timezone Database", "enabled");
php_info_print_table_row(2, "Timezone Database Version", tzdb->version);
php_info_print_table_end();
}
/* }}} */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/