protected function _checkInnerApi() { $sign = Pi::get('global.innerapi_sign', ''); $sign_name = Pi::get('global.innerapi_sign_name', '_pi_inner_nm'); if (Comm::req($sign_name) == $sign) { return true; } return false; }
protected function checkInnerApi() { $sign_name = Pi::get('global.innerapi_sign_name', '_pi_inner_nm'); $sign = Comm::req($sign_name, null); $mod = Comm::req('mod', null); if (!is_null($sign) && PiRPC::checkSign($mod, $sign)) { return true; } return false; }
static function Server() { $mod = Comm::req('mod'); $add = Comm::req('add'); $method = Comm::req('method'); $args = Comm::req('param', array()); try { $class = picom($mod, $add, true); if (is_callable(array($class, $method))) { $reflection = new ReflectionMethod($class, $method); $argnum = $reflection->getNumberOfParameters(); if ($argnum > count($args)) { self::output("inner api call the {$method} from {$mod} {$add} with err args", 5010); } //公共方法才允许被调用 $res = $reflection->invokeArgs($class, $args); self::output($res); } self::output("inner api not callable the {$mod} {$add} from {$method} fail", 5009); } catch (Exception $e) { self::output("inner api execute the {$mod} {$add} from {$method} fail", 5008); } }
protected function req($k, $def = '') { return Comm::req($k, $def); }