MCPcopy Create free account
hub / github.com/apache/skywalking-php / after_hook

Function after_hook

src/plugin/plugin_pdo.rs:206–231  ·  view source on GitHub ↗
(
    _: Option<i64>, span: Box<dyn Any>, execute_data: &mut ExecuteData, return_value: &mut ZVal,
)

Source from the content-addressed store, hash-verified

204}
205
206fn after_hook(
207 _: Option<i64>, span: Box<dyn Any>, execute_data: &mut ExecuteData, return_value: &mut ZVal,
208) -> crate::Result<()> {
209 let mut span = span.downcast::<Span>().unwrap();
210
211 if log_exception(&mut *span).is_some() {
212 return Ok(());
213 }
214
215 if let Some(b) = return_value.as_bool() {
216 if !b {
217 return after_hook_when_false(get_this_mut(execute_data)?, &mut span);
218 }
219 } else if let Some(obj) = return_value.as_mut_z_obj() {
220 let cls = obj.get_class();
221 let pdo_cls = ClassEntry::from_globals("PDOStatement").unwrap();
222 if cls.is_instance_of(pdo_cls) {
223 return after_hook_when_pdo_statement(get_this_mut(execute_data)?, obj);
224 } else {
225 let cls = cls.get_name().to_str()?;
226 debug!(cls, "not a subclass of PDOStatement");
227 }
228 }
229
230 Ok(())
231}
232
233fn after_hook_when_false(this: &mut ZObj, span: &mut Span) -> crate::Result<()> {
234 let info = this.call("errorInfo", [])?;

Callers

nothing calls this directly

Calls 4

log_exceptionFunction · 0.85
after_hook_when_falseFunction · 0.85
get_this_mutFunction · 0.85

Tested by

no test coverage detected