1
This commit is contained in:
parent
658603e0a0
commit
559c18cd98
@ -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;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
require_once('services/NoticeService.php');
|
||||
|
||||
class UnitTestController extends BaseAuthedController {
|
||||
|
||||
public function _handlePre()
|
||||
@ -35,10 +33,11 @@ class UnitTestController extends BaseAuthedController {
|
||||
return;
|
||||
}
|
||||
|
||||
services\NoticeService::send($content, $loop, $interval);
|
||||
myself()->_callServiceStatic('NoticeService', 'send', $content, $loop, $interval);
|
||||
//services\NoticeService::send($content, $loop, $interval);
|
||||
} catch (Exception $e){
|
||||
error_log($e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user