(
&self, function_name: &str,
)
| 141 | } |
| 142 | |
| 143 | fn hook_pdo_statement_methods( |
| 144 | &self, function_name: &str, |
| 145 | ) -> (Box<BeforeExecuteHook>, Box<AfterExecuteHook>) { |
| 146 | let function_name = function_name.to_owned(); |
| 147 | ( |
| 148 | Box::new(move |request_id, execute_data| { |
| 149 | let this = get_this_mut(execute_data)?; |
| 150 | let handle = this.handle(); |
| 151 | |
| 152 | debug!(handle, function_name, "call PDOStatement method"); |
| 153 | |
| 154 | let mut span = with_dsn(handle, |dsn| { |
| 155 | create_exit_span_with_dsn(request_id, "PDOStatement", &function_name, dsn) |
| 156 | })?; |
| 157 | |
| 158 | if let Some(query) = this.get_property("queryString").as_z_str() { |
| 159 | span.add_tag(TAG_DB_STATEMENT, query.to_str()?); |
| 160 | } else { |
| 161 | warn!("PDOStatement queryString is empty"); |
| 162 | } |
| 163 | |
| 164 | Ok(Box::new(span) as _) |
| 165 | }), |
| 166 | Box::new(after_hook), |
| 167 | ) |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | fn hack_dtor(this: &mut ZObj, new_dtor: sys::zend_object_dtor_obj_t) { |
no test coverage detected