Skip to main content

_zend_executor_globals

Struct _zend_executor_globals 

Source
#[repr(C)]
pub struct _zend_executor_globals {
Show 86 fields pub uninitialized_zval: zval, pub error_zval: zval, pub symtable_cache: [*mut zend_array; 32], pub symtable_cache_limit: *mut *mut zend_array, pub symtable_cache_ptr: *mut *mut zend_array, pub symbol_table: zend_array, pub included_files: HashTable, pub bailout: *mut sigjmp_buf, pub error_reporting: c_int, pub fatal_error_backtrace_on: bool, pub last_fatal_error_backtrace: zval, pub exit_status: c_int, pub function_table: *mut HashTable, pub class_table: *mut HashTable, pub zend_constants: *mut HashTable, pub vm_stack_top: *mut zval, pub vm_stack_end: *mut zval, pub vm_stack: zend_vm_stack, pub vm_stack_page_size: usize, pub current_execute_data: *mut _zend_execute_data, pub fake_scope: *const zend_class_entry, pub jit_trace_num: u32, pub current_observed_frame: *mut zend_execute_data, pub ticks_count: c_int, pub precision: zend_long, pub persistent_constants_count: u32, pub persistent_functions_count: u32, pub persistent_classes_count: u32, pub no_extensions: bool, pub full_tables_cleanup: bool, pub vm_interrupt: zend_atomic_bool, pub timed_out: zend_atomic_bool, pub in_autoload: *mut HashTable, pub hard_timeout: zend_long, pub stack_base: *mut c_void, pub stack_limit: *mut c_void, pub regular_list: HashTable, pub persistent_list: HashTable, pub user_error_handler_error_reporting: c_int, pub exception_ignore_args: bool, pub user_error_handler: zval, pub user_exception_handler: zval, pub user_error_handlers_error_reporting: zend_stack, pub user_error_handlers: zend_stack, pub user_exception_handlers: zend_stack, pub exception_class: *mut zend_class_entry, pub error_handling: zend_error_handling_t, pub capture_warnings_during_sccp: c_int, pub timeout_seconds: zend_long, pub ini_directives: *mut HashTable, pub modified_ini_directives: *mut HashTable, pub error_reporting_ini_entry: *mut zend_ini_entry, pub objects_store: zend_objects_store, pub lazy_objects_store: zend_lazy_objects_store, pub exception: *mut zend_object, pub prev_exception: *mut zend_object, pub opline_before_exception: *const zend_op, pub exception_op: [zend_op; 3], pub current_module: *mut _zend_module_entry, pub active: bool, pub flags: u8, pub assertions: zend_long, pub ht_iterators_count: u32, pub ht_iterators_used: u32, pub ht_iterators: *mut HashTableIterator, pub ht_iterators_slots: [HashTableIterator; 16], pub saved_fpu_cw_ptr: *mut c_void, pub trampoline: zend_function, pub call_trampoline_op: zend_op, pub weakrefs: HashTable, pub exception_string_param_max_len: zend_long, pub get_gc_buffer: zend_get_gc_buffer, pub main_fiber_context: *mut zend_fiber_context, pub current_fiber_context: *mut zend_fiber_context, pub active_fiber: *mut zend_fiber, pub fiber_stack_size: usize, pub record_errors: bool, pub num_errors: u32, pub errors: *mut *mut zend_error_info, pub filename_override: *mut zend_string, pub lineno_override: zend_long, pub call_stack: zend_call_stack, pub max_allowed_stack_size: zend_long, pub reserved_stack_size: zend_ulong, pub strtod_state: zend_strtod_state, pub reserved: [*mut c_void; 6],
}

Fields§

§uninitialized_zval: zval§error_zval: zval§symtable_cache: [*mut zend_array; 32]§symtable_cache_limit: *mut *mut zend_array§symtable_cache_ptr: *mut *mut zend_array§symbol_table: zend_array§included_files: HashTable§bailout: *mut sigjmp_buf§error_reporting: c_int§fatal_error_backtrace_on: bool§last_fatal_error_backtrace: zval§exit_status: c_int§function_table: *mut HashTable§class_table: *mut HashTable§zend_constants: *mut HashTable§vm_stack_top: *mut zval§vm_stack_end: *mut zval§vm_stack: zend_vm_stack§vm_stack_page_size: usize§current_execute_data: *mut _zend_execute_data§fake_scope: *const zend_class_entry§jit_trace_num: u32§current_observed_frame: *mut zend_execute_data§ticks_count: c_int§precision: zend_long§persistent_constants_count: u32§persistent_functions_count: u32§persistent_classes_count: u32§no_extensions: bool§full_tables_cleanup: bool§vm_interrupt: zend_atomic_bool§timed_out: zend_atomic_bool§in_autoload: *mut HashTable§hard_timeout: zend_long§stack_base: *mut c_void§stack_limit: *mut c_void§regular_list: HashTable§persistent_list: HashTable§user_error_handler_error_reporting: c_int§exception_ignore_args: bool§user_error_handler: zval§user_exception_handler: zval§user_error_handlers_error_reporting: zend_stack§user_error_handlers: zend_stack§user_exception_handlers: zend_stack§exception_class: *mut zend_class_entry§error_handling: zend_error_handling_t§capture_warnings_during_sccp: c_int§timeout_seconds: zend_long§ini_directives: *mut HashTable§modified_ini_directives: *mut HashTable§error_reporting_ini_entry: *mut zend_ini_entry§objects_store: zend_objects_store§lazy_objects_store: zend_lazy_objects_store§exception: *mut zend_object§prev_exception: *mut zend_object§opline_before_exception: *const zend_op§exception_op: [zend_op; 3]§current_module: *mut _zend_module_entry§active: bool§flags: u8§assertions: zend_long§ht_iterators_count: u32§ht_iterators_used: u32§ht_iterators: *mut HashTableIterator§ht_iterators_slots: [HashTableIterator; 16]§saved_fpu_cw_ptr: *mut c_void§trampoline: zend_function§call_trampoline_op: zend_op§weakrefs: HashTable§exception_string_param_max_len: zend_long§get_gc_buffer: zend_get_gc_buffer§main_fiber_context: *mut zend_fiber_context§current_fiber_context: *mut zend_fiber_context§active_fiber: *mut zend_fiber§fiber_stack_size: usize§record_errors: bool§num_errors: u32§errors: *mut *mut zend_error_info§filename_override: *mut zend_string§lineno_override: zend_long§call_stack: zend_call_stack§max_allowed_stack_size: zend_long§reserved_stack_size: zend_ulong§strtod_state: zend_strtod_state§reserved: [*mut c_void; 6]

Implementations§

Source§

impl _zend_executor_globals

Source

pub fn get() -> GlobalReadGuard<Self>

Returns a reference to the PHP executor globals.

The executor globals are guarded by a RwLock. There can be multiple immutable references at one time but only ever one mutable reference. Attempting to retrieve the globals while already holding the global guard will lead to a deadlock. Dropping the globals guard will release the lock.

§Panics
  • If static executor globals are not set
Source

pub fn get_mut() -> GlobalWriteGuard<Self>

Returns a mutable reference to the PHP executor globals.

The executor globals are guarded by a RwLock. There can be multiple immutable references at one time but only ever one mutable reference. Attempting to retrieve the globals while already holding the global guard will lead to a deadlock. Dropping the globals guard will release the lock.

§Panics
  • If static executor globals are not set
Source

pub fn class_table(&self) -> Option<&ZendHashTable>

Attempts to retrieve the global class hash table.

Source

pub fn function_table(&self) -> Option<&ZendHashTable>

Attempts to retrieve the global functions hash table.

Source

pub fn function_table_mut(&mut self) -> Option<&mut ZendHashTable>

Attempts to retrieve the global functions hash table as mutable.

Source

pub fn ini_values(&self) -> HashMap<String, Option<String>>

Retrieves the ini values for all ini directives in the current executor context..

Returns an empty map if the ini directives have not been registered yet, which is only the case before engine startup. Values that are not valid UTF-8 are decoded lossily, since a php.ini directive may hold arbitrary bytes; an absent value is reported as None.

Source

pub fn constants(&self) -> Option<&ZendHashTable>

Attempts to retrieve the global constants table.

Source

pub fn take_exception() -> Option<ZBox<ZendObject>>

Attempts to extract the last PHP exception captured by the interpreter. Returned inside a ZBox.

This function requires the executor globals to be mutably held, which could lead to a deadlock if the globals are already borrowed immutably or mutably.

Source

pub fn has_exception() -> bool

Checks if the executor globals contain an exception.

Source

pub fn exception(&self) -> Option<&ZendObject>

Borrows the pending exception without taking ownership of it.

The exception stays in the executor globals, so it keeps propagating on its own once control returns to PHP. Use take_exception to handle it from Rust instead.

Source

pub fn pending_exception_class() -> Option<String>

Returns the class name of the pending exception, leaving the exception where it is.

Returns None when no exception is pending. A class the engine cannot name is reported as Exception.

Source

pub fn throw_if_exception() -> PhpResult<()>

Attempts to extract the last PHP exception captured by the interpreter. Returned inside a PhpResult.

This function requires the executor globals to be mutably held, which could lead to a deadlock if the globals are already borrowed immutably or mutably.

§Errors

If an exception is present, it will be returned as Err value inside a PhpResult.

Source

pub fn request_interrupt(&mut self)

Request an interrupt of the PHP VM. This will call the registered interrupt handler function. set with crate::ffi::zend_interrupt_function.

Source

pub fn cancel_interrupt(&mut self)

Cancel a requested an interrupt of the PHP VM.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.