mirror of
https://github.com/danog/ext-php-rs.git
synced 2024-12-14 18:15:26 +01:00
parent
42ef04a8ae
commit
38cbba0457
@ -6,6 +6,8 @@ use crate::{
|
|||||||
types::{ZendClassObject, ZendObject, Zval},
|
types::{ZendClassObject, ZendObject, Zval},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use super::function::Function;
|
||||||
|
|
||||||
/// Execute data passed when a function is called from PHP.
|
/// Execute data passed when a function is called from PHP.
|
||||||
///
|
///
|
||||||
/// This generally contains things related to the call, including but not
|
/// This generally contains things related to the call, including but not
|
||||||
@ -194,6 +196,16 @@ impl ExecuteData {
|
|||||||
self.This.object_mut()
|
self.This.object_mut()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Attempt to retrieve the function that is being called.
|
||||||
|
pub fn function(&self) -> Option<&Function> {
|
||||||
|
unsafe { self.func.as_ref() }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Attempt to retrieve the previous execute data on the call stack.
|
||||||
|
pub fn previous(&self) -> Option<&Self> {
|
||||||
|
unsafe { self.prev_execute_data.as_ref() }
|
||||||
|
}
|
||||||
|
|
||||||
/// Translation of macro `ZEND_CALL_ARG(call, n)`
|
/// Translation of macro `ZEND_CALL_ARG(call, n)`
|
||||||
/// zend_compile.h:578
|
/// zend_compile.h:578
|
||||||
///
|
///
|
||||||
|
@ -2,7 +2,10 @@
|
|||||||
|
|
||||||
use std::{fmt::Debug, os::raw::c_char, ptr};
|
use std::{fmt::Debug, os::raw::c_char, ptr};
|
||||||
|
|
||||||
use crate::ffi::zend_function_entry;
|
use crate::{
|
||||||
|
ffi::{zend_function, zend_function_entry},
|
||||||
|
flags::FunctionType,
|
||||||
|
};
|
||||||
|
|
||||||
/// A Zend function entry.
|
/// A Zend function entry.
|
||||||
pub type FunctionEntry = zend_function_entry;
|
pub type FunctionEntry = zend_function_entry;
|
||||||
@ -36,3 +39,11 @@ impl FunctionEntry {
|
|||||||
Box::into_raw(Box::new(self))
|
Box::into_raw(Box::new(self))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub type Function = zend_function;
|
||||||
|
|
||||||
|
impl Function {
|
||||||
|
pub fn type_(&self) -> FunctionType {
|
||||||
|
FunctionType::from(unsafe { self.type_ })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user