-
Notifications
You must be signed in to change notification settings - Fork 2
/
encoding.cpp
77 lines (66 loc) · 1.79 KB
/
encoding.cpp
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
/* encoding extension for PHP */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
extern "C" {
#include "php.h"
#include "ext/standard/info.h"
#include "php_encoding.h"
#include "ext/spl/spl_exceptions.h"
#include "stubs/DataDecodeException_arginfo.h"
}
#include "classes/ByteBuffer.h"
#include "classes/Types.h"
#include "classes/DataDecodeException.h"
/* {{{ PHP_MINFO_FUNCTION */
PHP_MINFO_FUNCTION(encoding)
{
php_info_print_table_start();
php_info_print_table_header(2, "Version", PHP_ENCODING_VERSION);
php_info_print_table_header(2, "Experimental", "YES");
php_info_print_table_end();
}
/* }}} */
/* {{{ PHP_RINIT_FUNCTION
*/
PHP_RINIT_FUNCTION(encoding)
{
#if defined(ZTS) && defined(COMPILE_DL_ENCODING)
ZEND_TSRMLS_CACHE_UPDATE();
#endif
return SUCCESS;
}
/* }}} */
zend_class_entry* data_decode_exception_ce;
PHP_MINIT_FUNCTION(encoding) {
data_decode_exception_ce = register_class_pmmp_encoding_DataDecodeException(spl_ce_RuntimeException);
init_class_ByteBuffer();
init_class_Types();
return SUCCESS;
}
static const zend_module_dep module_dependencies[] = {
ZEND_MOD_REQUIRED("spl")
ZEND_MOD_END
};
/* {{{ encoding_module_entry */
zend_module_entry encoding_module_entry = {
STANDARD_MODULE_HEADER_EX,
NULL, /* ini_entries */
module_dependencies,
"encoding", /* Extension name */
NULL, /* zend_function_entry */
PHP_MINIT(encoding), /* PHP_MINIT - Module initialization */
NULL, /* PHP_MSHUTDOWN - Module shutdown */
PHP_RINIT(encoding), /* PHP_RINIT - Request initialization */
NULL, /* PHP_RSHUTDOWN - Request shutdown */
PHP_MINFO(encoding), /* PHP_MINFO - Module info */
PHP_ENCODING_VERSION, /* Version */
STANDARD_MODULE_PROPERTIES
};
/* }}} */
#ifdef COMPILE_DL_ENCODING
# ifdef ZTS
ZEND_TSRMLS_CACHE_DEFINE()
# endif
ZEND_GET_MODULE(encoding)
#endif