1
This commit is contained in:
parent
d04f973cf1
commit
d654bd893c
@ -276,15 +276,27 @@ class BaseController {
|
||||
return $channel == "0000";
|
||||
}
|
||||
|
||||
public function _getServiceConstant($serviceName, $name)
|
||||
{
|
||||
$this->_mustBeLoadService($serviceName);
|
||||
$reflectionConstant = new ReflectionClassConstant('services\\' . $serviceName, $name);
|
||||
return $reflectionConstant->getValue();;
|
||||
}
|
||||
|
||||
public function _callServiceStatic($serviceName, $funcName, ...$args)
|
||||
{
|
||||
$this->_mustBeLoadService($serviceName);
|
||||
$method = new ReflectionMethod('services\\' . $serviceName, $funcName);
|
||||
$ret = $method->invoke(null, ...$args);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
private function _mustBeLoadService($serviceName)
|
||||
{
|
||||
if (!array_key_exists($serviceName, $this->serviceHash)) {
|
||||
require_once('services/' . $serviceName . '.php');
|
||||
$this->serviceHash[$serviceName] = $this->_getNowTime();
|
||||
}
|
||||
$method = new ReflectionMethod('services\\' . $serviceName, $funcName);
|
||||
$ret = $method->invoke(null, ...$args);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function _getGameId() {
|
||||
|
24
webapp/mt/Bigwheel.php
Normal file
24
webapp/mt/Bigwheel.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace mt;
|
||||
|
||||
use phpcommon;
|
||||
|
||||
class Bigwheel
|
||||
{
|
||||
|
||||
public static function get($id)
|
||||
{
|
||||
return getXVal(self::getMetaList(), $id);
|
||||
}
|
||||
|
||||
protected static function getMetaList()
|
||||
{
|
||||
if (!self::$metaList) {
|
||||
self::$metaList = getMetaTable('Bigwheel@Bigwheel.php');
|
||||
}
|
||||
return self::$metaList;
|
||||
}
|
||||
|
||||
protected static $metaList;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user