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

Method hook

src/plugin/plugin_pdo.rs:55–83  ·  view source on GitHub ↗
(
        &self, class_name: Option<&str>, function_name: &str,
    )

Source from the content-addressed store, hash-verified

53 }
54
55 fn hook(
56 &self, class_name: Option<&str>, function_name: &str,
57 ) -> Option<(
58 Box<crate::execute::BeforeExecuteHook>,
59 Box<crate::execute::AfterExecuteHook>,
60 )> {
61 match (class_name, function_name) {
62 (Some("PDO"), "__construct") => Some(self.hook_pdo_construct()),
63 (Some("PDO"), f)
64 if [
65 "exec",
66 "query",
67 "prepare",
68 "commit",
69 "begintransaction",
70 "rollback",
71 ]
72 .contains(&f) =>
73 {
74 Some(self.hook_pdo_methods(function_name))
75 }
76 (Some("PDOStatement"), f)
77 if ["execute", "fetch", "fetchAll", "fetchColumn", "fetchObject"].contains(&f) =>
78 {
79 Some(self.hook_pdo_statement_methods(function_name))
80 }
81 _ => None,
82 }
83 }
84}
85
86impl PdoPlugin {

Callers 1

select_plugin_hookFunction · 0.45

Calls 3

hook_pdo_constructMethod · 0.80
hook_pdo_methodsMethod · 0.80

Tested by

no test coverage detected