Esempio n. 1
0
 /**
  * 架构函数
  * @access public
  */
 public function __construct()
 {
     //控制器初始化
     if (method_exists($this, '_initialize')) {
         $this->_initialize();
     }
     //导入类库
     think\Loader::import('vendor.Hprose.HproseHttpServer');
     //实例化HproseHttpServer
     $server = new \HproseHttpServer();
     if ($this->allowMethodList) {
         $methods = $this->allowMethodList;
     } else {
         $methods = get_class_methods($this);
         $methods = array_diff($methods, array('__construct', '__call', '_initialize'));
     }
     $server->addMethods($methods, $this);
     if (APP_DEBUG || $this->debug) {
         $server->setDebugEnabled(true);
     }
     // Hprose设置
     $server->setCrossDomainEnabled($this->crossDomain);
     $server->setP3PEnabled($this->P3P);
     $server->setGetEnabled($this->get);
     // 启动server
     $server->start();
 }
Esempio n. 2
0
 /**
  * 架构函数
  * @access public
  */
 public function __construct()
 {
     //控制器初始化
     if (method_exists($this, '_initialize')) {
         $this->_initialize();
     }
     //导入类库
     think\Loader::import('vendor.jsonrpc.jsonRPCServer');
     // 启动server
     \jsonRPCServer::handle($this);
 }
Esempio n. 3
0
 /**
  * 架构函数
  * @access public
  */
 public function __construct()
 {
     //控制器初始化
     if (method_exists($this, '_initialize')) {
         $this->_initialize();
     }
     //导入类库
     think\Loader::import('vendor.phprpc.phprpc_server');
     //实例化phprpc
     $server = new \PHPRPC_Server();
     if ($this->allowMethodList) {
         $methods = $this->allowMethodList;
     } else {
         $methods = get_class_methods($this);
         $methods = array_diff($methods, array('__construct', '__call', '_initialize'));
     }
     $server->add($methods, $this);
     if (APP_DEBUG || $this->debug) {
         $server->setDebugMode(true);
     }
     $server->setEnableGZIP(true);
     $server->start();
     echo $server->comment();
 }
Esempio n. 4
0
File: base.php Progetto: dkoin/think
/**
 * 渲染输出Widget
 * @param string $name Widget名称
 * @param array $data 传人的参数
 * @return mixed
 */
function W($name, $data = [])
{
    return think\Loader::action($name, $data, 'Widget');
}