XYZRAccServer.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. namespace fcgisrv;
  3. require_once(BASE_ROOT_PATH . '/helper/area_helper.php');
  4. require_once(BASE_CORE_PATH . '/framework/function/http.php');
  5. require_once(BASE_ROOT_PATH . '/helper/session_helper.php');
  6. require_once(BASE_ROOT_PATH . '/helper/sensitive_word/dfa.php');
  7. require_once(BASE_ROOT_PATH . '/helper/exceptionex.php');
  8. require_once(BASE_HELPER_PATH . '/fcgisrv/BaseServer.php');
  9. require_once(BASE_HELPER_PATH . '/refill/util.php');
  10. use Log;
  11. use Base;
  12. use UnSignException;
  13. use Exception;
  14. use merchantControl;
  15. use errcode;
  16. class XYZRAccServer extends BaseServer
  17. {
  18. public function __construct($subPath)
  19. {
  20. parent::__construct($subPath);
  21. $exfiles = [
  22. ];
  23. $this->setExFiles($exfiles);
  24. }
  25. static private $stInstance = NULL;
  26. static public function instance()
  27. {
  28. if(self::$stInstance == NULL) {
  29. self::$stInstance = new XYZRAccServer('racc');
  30. }
  31. return self::$stInstance;
  32. }
  33. function handle_req($file)
  34. {
  35. try
  36. {
  37. Log::record("file is {$file}",Log::DEBUG);
  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. }