LZRAccServer.php 1.8 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. use LzException;
  17. class LZRAccServer extends BaseServer
  18. {
  19. public function __construct($subPath)
  20. {
  21. parent::__construct($subPath);
  22. $exfiles = [];
  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 RAccServer('racc');
  30. }
  31. return self::$stInstance;
  32. }
  33. function handle_req($file)
  34. {
  35. try
  36. {
  37. if(file_exists($file))
  38. {
  39. if($this->is_exclude($file)) {
  40. Log::record("Call {$file}",Log::DEBUG);
  41. include $file;
  42. } else {
  43. Base::mobile_control();
  44. }
  45. }
  46. else
  47. {
  48. fcgi_header("Content-Type: text/html; charset=UTF-8");
  49. echo "no such file.";
  50. }
  51. }
  52. catch (LzException $ex) {
  53. echo ($ex->getMessage());
  54. }
  55. catch (Exception $ex) {
  56. merchantControl::outerr($ex->getCode(),$ex->getMessage());
  57. Log::record("run_looper exception catch code={$ex->getCode()} msg={$ex->getMessage()} trace={$ex->getTraceAsString()}",Log::ERR);
  58. }
  59. }
  60. }