LZRAccServer.php 2.2 KB

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