Esempio n. 1
0
File: Proxy.php Progetto: hihus/pi
 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 {
         $this->instance = Pi::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);
     }
 }