@@ -5,7 +5,7 @@ use phper::sys::{OnUpdateString, zend_class_entry, zend_register_internal_class,
5
5
use phper:: zend:: api:: { FunctionEntries , ModuleGlobals , function_entry_end} ;
6
6
use phper:: zend:: compile:: { InternalArgInfos , internal_arg_info_begin} ;
7
7
use phper:: zend:: ini:: { IniEntryDefs , ini_entry_def_end} ;
8
- use phper:: zend:: modules:: { ModuleEntry , create_zend_module_entry} ;
8
+ use phper:: zend:: modules:: { ModuleEntry , create_zend_module_entry, ModuleArgs } ;
9
9
use phper:: zend:: types:: { ExecuteData , Val , SetVal , Value , ClassEntry } ;
10
10
use phper:: {
11
11
php_function, php_minit, php_minit_function, php_mshutdown, php_mshutdown_function,
@@ -32,40 +32,35 @@ static INI_ENTRIES: IniEntryDefs<3> = IniEntryDefs::new([
32
32
] ) ;
33
33
34
34
#[ php_minit_function]
35
- fn m_init_simple ( type_ : c_int , module_number : c_int ) -> bool {
36
- unsafe {
37
- zend_register_ini_entries ( INI_ENTRIES . as_ptr ( ) , module_number) ;
38
-
39
- MY_CLASS_CE . init ( c_str_ptr ! ( "MyClass" ) , & MY_CLASS_METHODS ) ;
40
- MY_CLASS_CE . declare_property ( "foo" , 3 , ZEND_ACC_PUBLIC ) ;
41
- }
35
+ fn m_init_simple ( args : ModuleArgs ) -> bool {
36
+ args. register_ini_entries ( & INI_ENTRIES ) ;
37
+ MY_CLASS_CE . init ( c_str_ptr ! ( "MyClass" ) , & MY_CLASS_METHODS ) ;
38
+ MY_CLASS_CE . declare_property ( "foo" , 3 , ZEND_ACC_PUBLIC ) ;
42
39
true
43
40
}
44
41
45
42
#[ php_mshutdown_function]
46
- fn m_shutdown_simple ( type_ : c_int , module_number : c_int ) -> bool {
47
- unsafe {
48
- zend_unregister_ini_entries ( module_number) ;
49
- }
43
+ fn m_shutdown_simple ( args : ModuleArgs ) -> bool {
44
+ args. unregister_ini_entries ( ) ;
50
45
true
51
46
}
52
47
53
48
#[ php_rinit_function]
54
- fn r_init_simple ( type_ : c_int , module_number : c_int ) -> bool {
49
+ fn r_init_simple ( args : ModuleArgs ) -> bool {
55
50
true
56
51
}
57
52
58
53
#[ php_rshutdown_function]
59
- fn r_shutdown_simple ( type_ : c_int , module_number : c_int ) -> bool {
54
+ fn r_shutdown_simple ( args : ModuleArgs ) -> bool {
60
55
true
61
56
}
62
57
63
58
#[ php_minfo_function]
64
59
fn m_info_simple ( zend_module : * mut :: phper:: sys:: zend_module_entry ) {
65
60
unsafe {
66
61
php_info_print_table_start ( ) ;
67
- php_info_print_table_row ( 2 , if SIMPLE_ENABLE . get ( ) { c_str_ptr ! ( "1" ) } else { c_str_ptr ! ( "0" ) } ) ;
68
- php_info_print_table_row ( 2 , c_str_ptr ! ( "simple.text" ) , SIMPLE_TEXT . as_ptr ( ) ) ;
62
+ php_info_print_table_row ( 2 , c_str_ptr ! ( "simple.enable" ) , if SIMPLE_ENABLE . get ( ) { c_str_ptr ! ( "1" ) } else { c_str_ptr ! ( "0" ) } ) ;
63
+ php_info_print_table_row ( 2 , c_str_ptr ! ( "simple.text" ) , SIMPLE_TEXT . get ( ) ) ;
69
64
php_info_print_table_end ( ) ;
70
65
}
71
66
}
0 commit comments