@@ -10,16 +10,22 @@ use parking_lot::{const_rwlock, RwLock, RwLockReadGuard, RwLockWriteGuard};
1010
1111use crate :: boxed:: ZBox ;
1212use crate :: exception:: PhpResult ;
13+ #[ cfg( php80) ]
14+ use crate :: ffi:: _zend_hash_find_known_hash;
1315#[ cfg( php82) ]
1416use crate :: ffi:: zend_atomic_bool_store;
1517use 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,
2329} ;
2430
2531use crate :: types:: { ZendHashTable , ZendObject , ZendStr } ;
@@ -289,6 +295,9 @@ impl ProcessGlobals {
289295 /// - If the request global is not found or fails to be populated.
290296 /// - If the request global is not a ZendArray.
291297 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) ) ]
292301 let key = unsafe {
293302 * zend_known_strings. add ( _zend_known_string_id_ZEND_STR_AUTOGLOBAL_REQUEST as usize )
294303 } ;
@@ -298,7 +307,11 @@ impl ProcessGlobals {
298307 panic ! ( "Failed to get request global" ) ;
299308 }
300309
310+ #[ cfg( php80) ]
311+ let request = unsafe { _zend_hash_find_known_hash ( & executor_globals. symbol_table , key) } ;
312+ #[ cfg( not( php80) ) ]
301313 let request = unsafe { zend_hash_find_known_hash ( & executor_globals. symbol_table , key) } ;
314+
302315 if request. is_null ( ) {
303316 return None ;
304317 }
0 commit comments