@@ -10,16 +10,22 @@ use parking_lot::{const_rwlock, RwLock, RwLockReadGuard, RwLockWriteGuard};
10
10
11
11
use crate :: boxed:: ZBox ;
12
12
use crate :: exception:: PhpResult ;
13
+ #[ cfg( php80) ]
14
+ use crate :: ffi:: _zend_hash_find_known_hash;
13
15
#[ cfg( php82) ]
14
16
use crate :: ffi:: zend_atomic_bool_store;
15
17
use crate :: ffi:: {
16
- _sapi_module_struct, _zend_executor_globals, _zend_known_string_id_ZEND_STR_AUTOGLOBAL_REQUEST,
17
- executor_globals, ext_php_rs_executor_globals, ext_php_rs_file_globals,
18
- ext_php_rs_process_globals, ext_php_rs_sapi_globals, ext_php_rs_sapi_module, php_core_globals,
19
- php_file_globals, sapi_globals_struct, sapi_header_struct, sapi_headers_struct,
20
- sapi_request_info, zend_hash_find_known_hash, zend_ini_entry, zend_is_auto_global,
21
- zend_known_strings, TRACK_VARS_COOKIE , TRACK_VARS_ENV , TRACK_VARS_FILES , TRACK_VARS_GET ,
22
- TRACK_VARS_POST , TRACK_VARS_SERVER ,
18
+ _sapi_module_struct, _zend_executor_globals, _zend_string, executor_globals,
19
+ ext_php_rs_executor_globals, ext_php_rs_file_globals, ext_php_rs_process_globals,
20
+ ext_php_rs_sapi_globals, ext_php_rs_sapi_module, php_core_globals, php_file_globals,
21
+ sapi_globals_struct, sapi_header_struct, sapi_headers_struct, sapi_request_info,
22
+ zend_ini_entry, zend_is_auto_global, TRACK_VARS_COOKIE , TRACK_VARS_ENV , TRACK_VARS_FILES ,
23
+ TRACK_VARS_GET , TRACK_VARS_POST , TRACK_VARS_SERVER ,
24
+ } ;
25
+ #[ cfg( not( php80) ) ]
26
+ use crate :: ffi:: {
27
+ _zend_known_string_id_ZEND_STR_AUTOGLOBAL_REQUEST, zend_hash_find_known_hash,
28
+ zend_known_strings,
23
29
} ;
24
30
25
31
use crate :: types:: { ZendHashTable , ZendObject , ZendStr } ;
@@ -289,6 +295,9 @@ impl ProcessGlobals {
289
295
/// - If the request global is not found or fails to be populated.
290
296
/// - If the request global is not a ZendArray.
291
297
pub fn http_request_vars ( & self ) -> Option < & ZendHashTable > {
298
+ #[ cfg( php80) ]
299
+ let key = _zend_string:: new ( "_REQUEST" , false ) . as_mut_ptr ( ) ;
300
+ #[ cfg( not( php80) ) ]
292
301
let key = unsafe {
293
302
* zend_known_strings. add ( _zend_known_string_id_ZEND_STR_AUTOGLOBAL_REQUEST as usize )
294
303
} ;
@@ -298,7 +307,11 @@ impl ProcessGlobals {
298
307
panic ! ( "Failed to get request global" ) ;
299
308
}
300
309
310
+ #[ cfg( php80) ]
311
+ let request = unsafe { _zend_hash_find_known_hash ( & executor_globals. symbol_table , key) } ;
312
+ #[ cfg( not( php80) ) ]
301
313
let request = unsafe { zend_hash_find_known_hash ( & executor_globals. symbol_table , key) } ;
314
+
302
315
if request. is_null ( ) {
303
316
return None ;
304
317
}
0 commit comments