-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestextension.cpp
More file actions
55 lines (45 loc) · 1.51 KB
/
Copy pathtestextension.cpp
File metadata and controls
55 lines (45 loc) · 1.51 KB
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
#include <php.h>
#include <php_ini.h>
#include <Zend/zend_exceptions.h>
#include <Zend/zend_types.h>
// change it on some unique name, 'serialize2' for example
#define FNAME serialize
ZEND_MINIT_FUNCTION(TestExtension);
ZEND_METHOD(TestExtension, FNAME);
static zend_function_entry functions[] = {
{ NULL, NULL, NULL }
};
zend_module_entry TestExtension_module_entry = {
STANDARD_MODULE_HEADER,
"TestExtension",
NULL,
ZEND_MINIT(TestExtension),
NULL,
NULL,
NULL,
NULL,
"Test",
STANDARD_MODULE_PROPERTIES
};
#pragma GCC visibility push(default)
extern "C" {
ZEND_GET_MODULE(TestExtension)
}
#pragma GCC visibility pop
zend_class_entry *dalClassEntry;
static zend_function_entry dalClassFunctions[] = {
ZEND_ME(TestExtension, FNAME, NULL, ZEND_ACC_STATIC | ZEND_ACC_PUBLIC)
{ NULL, NULL, NULL }
};
ZEND_MINIT_FUNCTION(TestExtension)
{
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "TestExtension", dalClassFunctions);
dalClassEntry = zend_register_internal_class(&ce TSRMLS_CC);
return SUCCESS;
}
ZEND_METHOD(TestExtension, FNAME)
{
array_init(return_value);
add_next_index_string(return_value, "Test");
}