Exemplo n.º 1
0
 public function __call($method, $args)
 {
     //在远程调用配置里面的接口走远程调用
     if (isset($this->conf['#all']) || isset($this->conf[$method])) {
         $conf = isset($this->conf['#all']) ? $this->conf['#all'] : $this->conf[$method];
         $rpc = new PiRPC();
         return $rpc->call($method, $args, $this->mod, $this->add, $conf);
     } else {
         pi_load_export_file($this->mod, $this->add);
         if (!is_callable(array($this->instance, $method))) {
             throw new Exception("proxy.err {$mod} {$add} no method {$method}", 5009);
         }
         return pi_call_method($this->instance, $method, $args);
     }
 }
Exemplo n.º 2
0
Arquivo: Api.php Projeto: hihus/pi
 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;
 }