File tree Expand file tree Collapse file tree 3 files changed +6
-14
lines changed Expand file tree Collapse file tree 3 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ use phper::{
14
14
} ,
15
15
} ;
16
16
17
- static SIMPLE_ENABLE : ModuleGlobals < bool > = ModuleGlobals :: new ( false ) ;
17
+ static HELLO_ENABLE : ModuleGlobals < bool > = ModuleGlobals :: new ( false ) ;
18
18
19
- static INI_ENTRIES : IniEntries < 1 > = IniEntries :: new ( [ SIMPLE_ENABLE . create_ini_entry (
19
+ static INI_ENTRIES : IniEntries < 1 > = IniEntries :: new ( [ HELLO_ENABLE . create_ini_entry (
20
20
"hello.enable" ,
21
21
"1" ,
22
22
Some ( OnUpdateBool ) ,
@@ -53,7 +53,7 @@ fn module_info(module: &ModuleEntry) {
53
53
php_info_print_table_row (
54
54
2 ,
55
55
c_str_ptr ! ( "hello.enable" ) ,
56
- if SIMPLE_ENABLE . get ( ) {
56
+ if HELLO_ENABLE . get ( ) {
57
57
c_str_ptr ! ( "1" )
58
58
} else {
59
59
c_str_ptr ! ( "0" )
@@ -71,7 +71,7 @@ pub fn say_hello(execute_data: &mut ExecuteData) -> impl SetVal {
71
71
}
72
72
73
73
static ARG_INFO_SAY_HELLO : MultiInternalArgInfo < 1 > =
74
- MultiInternalArgInfo :: new ( 1 , false , [ create_zend_arg_info ( c_str_ptr ! ( "name " ) , false ) ] ) ;
74
+ MultiInternalArgInfo :: new ( 1 , false , [ create_zend_arg_info ( c_str_ptr ! ( "n_ame " ) , false ) ] ) ;
75
75
76
76
static FUNCTION_ENTRIES : FunctionEntries < 1 > = FunctionEntries :: new ( [ zend_function_entry {
77
77
fname : c_str_ptr ! ( "say_hello" ) ,
Original file line number Diff line number Diff line change 1
1
use proc_macro:: TokenStream ;
2
2
use quote:: quote;
3
- use syn:: { parse_macro_input, Ident , ItemFn , Visibility } ;
4
-
5
- pub ( crate ) fn rename ( input : TokenStream , prefix : impl ToString ) -> TokenStream {
6
- let input = parse_macro_input ! ( input as Ident ) ;
7
- let name = prefix. to_string ( ) + & input. to_string ( ) ;
8
- let name = Ident :: new ( & name, input. span ( ) . clone ( ) ) ;
9
- let result = quote ! { #name } ;
10
- result. into ( )
11
- }
3
+ use syn:: { parse_macro_input, ItemFn , Visibility } ;
12
4
13
5
pub ( crate ) fn hook_fn ( input : TokenStream ) -> TokenStream {
14
6
let input = parse_macro_input ! ( input as ItemFn ) ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ mod alloc;
2
2
mod inner;
3
3
mod utils;
4
4
5
- use crate :: inner:: { hook_fn, info_fn, rename } ;
5
+ use crate :: inner:: { hook_fn, info_fn} ;
6
6
use proc_macro:: TokenStream ;
7
7
8
8
#[ proc_macro]
You can’t perform that action at this time.
0 commit comments