From 559c18cd98619b5cf2419e99ecdb95c53ce87bd5 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 31 Jul 2024 19:06:53 +0800 Subject: [PATCH] 1 --- webapp/controller/BaseController.class.php | 6 +++--- webapp/controller/UnitTestController.class.php | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/webapp/controller/BaseController.class.php b/webapp/controller/BaseController.class.php index 376e3e6e..b521ca20 100644 --- a/webapp/controller/BaseController.class.php +++ b/webapp/controller/BaseController.class.php @@ -276,14 +276,14 @@ class BaseController { return $channel == "0000"; } - public function callService($serviceName, $funcName) + public function _callServiceStatic($serviceName, $funcName, ...$args) { if (!array_key_exists($serviceName, $this->serviceHash)) { require_once('services/' . $serviceName . '.php'); $this->serviceHash[$serviceName] = $this->_getNowTime(); } - $method = new ReflectionMethod($serviceName . 'Service', $funcName); - $ret = $method->invoke(null); + $method = new ReflectionMethod('services\\' . $serviceName, $funcName); + $ret = $method->invoke(null, ...$args); return $ret; } diff --git a/webapp/controller/UnitTestController.class.php b/webapp/controller/UnitTestController.class.php index 4a680219..33e9756b 100644 --- a/webapp/controller/UnitTestController.class.php +++ b/webapp/controller/UnitTestController.class.php @@ -1,7 +1,5 @@ _callServiceStatic('NoticeService', 'send', $content, $loop, $interval); + //services\NoticeService::send($content, $loop, $interval); } catch (Exception $e){ error_log($e); } } - + }