RAccServer.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. namespace fcgisrv;
  3. require_once(BASE_HELPER_PATH . '/fcgisrv/BaseServer.php');
  4. require_once(BASE_ROOT_PATH . '/helper/area_helper.php');
  5. require_once(BASE_CORE_PATH . '/framework/function/http.php');
  6. require_once(BASE_ROOT_PATH . '/helper/session_helper.php');
  7. require_once(BASE_ROOT_PATH . '/helper/sensitive_word/dfa.php');
  8. require_once(BASE_ROOT_PATH . '/helper/exceptionex.php');
  9. require_once(BASE_PATH . '/control/merchant.php');
  10. use Log;
  11. use Base;
  12. use UnSignException;
  13. use Exception;
  14. use merchantControl;
  15. use errcode;
  16. class RAccServer extends BaseServer
  17. {
  18. public function __construct($subPath)
  19. {
  20. parent::__construct($subPath);
  21. $exfiles = [
  22. 'callback/baizeyd.php','callback/am.php','callback/bhc.php',
  23. ];
  24. $this->setExFiles($exfiles);
  25. }
  26. static private $stInstance = NULL;
  27. static public function instance()
  28. {
  29. if(self::$stInstance == NULL) {
  30. self::$stInstance = new RAccServer('racc');
  31. }
  32. return self::$stInstance;
  33. }
  34. function handle_req($file)
  35. {
  36. try
  37. {
  38. if(file_exists($file))
  39. {
  40. if($this->is_exclude($file)) {
  41. Log::record("Call {$file}",Log::DEBUG);
  42. include $file;
  43. } else {
  44. Base::mobile_control();
  45. }
  46. }
  47. else
  48. {
  49. fcgi_header("Content-Type: text/html; charset=UTF-8");
  50. echo "no such file.";
  51. }
  52. }
  53. catch (UnSignException $ex) {
  54. merchantControl::outerr(errcode::ErrUnLogin,errcode::msg(errcode::ErrUnLogin));
  55. }
  56. catch (Exception $ex) {
  57. merchantControl::outerr($ex->getCode(),$ex->getMessage());
  58. Log::record("run_looper exception catch code={$ex->getCode()} msg={$ex->getMessage()} trace={$ex->getTraceAsString()}",Log::ERR);
  59. }
  60. }
  61. }