JsonRpcController.class.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006-2014 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: liu21st <liu21st@gmail.com>
  10. // +----------------------------------------------------------------------
  11. namespace Think\Controller;
  12. /**
  13. * ThinkPHP JsonRPC控制器类
  14. */
  15. class JsonRpcController {
  16. /**
  17. * 架构函数
  18. * @access public
  19. */
  20. public function __construct() {
  21. //控制器初始化
  22. if(method_exists($this,'_initialize'))
  23. $this->_initialize();
  24. //导入类库
  25. Vendor('jsonRPC.jsonRPCServer');
  26. // 启动server
  27. \jsonRPCServer::handle($this);
  28. }
  29. /**
  30. * 魔术方法 有不存在的操作的时候执行
  31. * @access public
  32. * @param string $method 方法名
  33. * @param array $args 参数
  34. * @return mixed
  35. */
  36. public function __call($method,$args){}
  37. }