1
This commit is contained in:
parent
658603e0a0
commit
559c18cd98
@ -276,14 +276,14 @@ class BaseController {
|
|||||||
return $channel == "0000";
|
return $channel == "0000";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function callService($serviceName, $funcName)
|
public function _callServiceStatic($serviceName, $funcName, ...$args)
|
||||||
{
|
{
|
||||||
if (!array_key_exists($serviceName, $this->serviceHash)) {
|
if (!array_key_exists($serviceName, $this->serviceHash)) {
|
||||||
require_once('services/' . $serviceName . '.php');
|
require_once('services/' . $serviceName . '.php');
|
||||||
$this->serviceHash[$serviceName] = $this->_getNowTime();
|
$this->serviceHash[$serviceName] = $this->_getNowTime();
|
||||||
}
|
}
|
||||||
$method = new ReflectionMethod($serviceName . 'Service', $funcName);
|
$method = new ReflectionMethod('services\\' . $serviceName, $funcName);
|
||||||
$ret = $method->invoke(null);
|
$ret = $method->invoke(null, ...$args);
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once('services/NoticeService.php');
|
|
||||||
|
|
||||||
class UnitTestController extends BaseAuthedController {
|
class UnitTestController extends BaseAuthedController {
|
||||||
|
|
||||||
public function _handlePre()
|
public function _handlePre()
|
||||||
@ -35,7 +33,8 @@ class UnitTestController extends BaseAuthedController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
services\NoticeService::send($content, $loop, $interval);
|
myself()->_callServiceStatic('NoticeService', 'send', $content, $loop, $interval);
|
||||||
|
//services\NoticeService::send($content, $loop, $interval);
|
||||||
} catch (Exception $e){
|
} catch (Exception $e){
|
||||||
error_log($e);
|
error_log($e);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user