From e273dc78a7c8c3d4cd6ca8023bbccd35f8d73eab Mon Sep 17 00:00:00 2001 From: jmjoy Date: Sat, 30 Nov 2024 22:03:10 +0800 Subject: [PATCH] Support `Swoole\Http\Server` --- src/plugin/plugin_swoole.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugin/plugin_swoole.rs b/src/plugin/plugin_swoole.rs index 46112f1..93ce2f4 100644 --- a/src/plugin/plugin_swoole.rs +++ b/src/plugin/plugin_swoole.rs @@ -30,7 +30,11 @@ pub struct SwooleServerPlugin; impl Plugin for SwooleServerPlugin { #[inline] fn class_names(&self) -> Option<&'static [&'static str]> { - Some(&[r"Swoole\Server", r"Swoole\Coroutine\Http\Server"]) + Some(&[ + r"Swoole\Server", + r"Swoole\Http\Server", + r"Swoole\Coroutine\Http\Server", + ]) } #[inline] @@ -42,7 +46,7 @@ impl Plugin for SwooleServerPlugin { &self, class_name: Option<&str>, function_name: &str, ) -> Option<(Box, Box)> { match (class_name, function_name) { - (Some(r"Swoole\Server"), "on") => Some(self.hook_on()), + (Some(r"Swoole\Server" | r"Swoole\Http\Server"), "on") => Some(self.hook_on()), (Some(r"Swoole\Coroutine\Http\Server"), "handle") => Some(self.hook_handle()), _ => None, }