JsonRpcController.class.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. use jsonRPCServer as jsonRPCServer;
  16. class JsonRpcController
  17. {
  18. /**
  19. * 架构函数
  20. * @access public
  21. */
  22. public function __construct()
  23. {
  24. //控制器初始化
  25. if (method_exists($this, '_initialize')) {
  26. $this->_initialize();
  27. }
  28. //导入类库
  29. Vendor('jsonRPC.jsonRPCServer');
  30. // 启动server
  31. \jsonRPCServer::handle($this);
  32. }
  33. /**
  34. * 魔术方法 有不存在的操作的时候执行
  35. * @access public
  36. * @param string $method 方法名
  37. * @param array $args 参数
  38. * @return mixed
  39. */
  40. public function __call($method, $args)
  41. {}
  42. }