File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ fn main() {
37
37
run_time_cache,
38
38
fibers,
39
39
trigger_time_sample,
40
+ vernum,
40
41
) ;
41
42
42
43
cfg_php_major_version ( vernum) ;
@@ -86,12 +87,19 @@ fn build_zend_php_ffis(
86
87
run_time_cache : bool ,
87
88
fibers : bool ,
88
89
trigger_time_sample : bool ,
90
+ vernum : u64 ,
89
91
) {
90
92
println ! ( "cargo:rerun-if-changed=src/php_ffi.h" ) ;
91
93
println ! ( "cargo:rerun-if-changed=src/php_ffi.c" ) ;
92
94
println ! ( "cargo:rerun-if-changed=../ext/handlers_api.c" ) ;
93
95
println ! ( "cargo:rerun-if-changed=../ext/handlers_api.h" ) ;
94
96
97
+ let sandbox = if vernum < 80000 {
98
+ "../zend_abstract_interface/sandbox/php7/sandbox.c"
99
+ } else {
100
+ "../zend_abstract_interface/sandbox/php8/sandbox.c"
101
+ } ;
102
+
95
103
// Profiling only needs config and its dependencies.
96
104
let zai_c_files = [
97
105
"../zend_abstract_interface/config/config_decode.c" ,
@@ -101,6 +109,7 @@ fn build_zend_php_ffis(
101
109
"../zend_abstract_interface/env/env.c" ,
102
110
"../zend_abstract_interface/exceptions/exceptions.c" ,
103
111
"../zend_abstract_interface/symbols/lookup.c" ,
112
+ sandbox,
104
113
"../zend_abstract_interface/json/json.c" ,
105
114
"../zend_abstract_interface/zai_string/string.c" ,
106
115
] ;
Original file line number Diff line number Diff line change @@ -60,6 +60,12 @@ impl ExceptionProfilingStats {
60
60
#[ cfg( php8) ]
61
61
let exception_name = unsafe { ( * exception) . class_name ( ) } ;
62
62
63
+ #[ cfg( php7) ]
64
+ let message = unsafe {
65
+ zend:: zai_str_from_zstr ( zend:: zai_exception_message ( ( * exception) . value . obj ) . as_mut ( ) )
66
+ . into_string ( )
67
+ } ;
68
+ #[ cfg( php8) ]
63
69
let message = unsafe {
64
70
zend:: zai_str_from_zstr ( zend:: zai_exception_message ( exception) . as_mut ( ) ) . into_string ( )
65
71
} ;
Original file line number Diff line number Diff line change 5
5
#include <stdint.h>
6
6
#include <string.h>
7
7
8
- /* needed by zend_abstract_interface/sandbox/sandbox.h which is included in
9
- * zend_abstract_interface/symbols/lookup.c which we need due to
10
- * zend_abstract_interface/exceptions/exeptions.c */
11
- long zai_sandbox_active = 0 ;
12
-
13
8
#if CFG_STACK_WALKING_TESTS
14
9
#include <dlfcn.h> // for dlsym
15
10
#endif
You can’t perform that action at this time.
0 commit comments