LZRAccServer.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. 'callback/lingzh/legou.php' ,'callback/lingzh/feiniao.php','callback/lingzh/fensheng.php',
  26. 'callback/lingzh/riying.php' ,'callback/lingzh/wailing.php','callback/lingzh/weishengy.php',
  27. 'callback/lingzh/shengying.php','callback/lingzh/amingjdman.php'
  28. ];
  29. $this->setExFiles($exfiles);
  30. }
  31. static private $stInstance = NULL;
  32. static public function instance()
  33. {
  34. if(self::$stInstance == NULL) {
  35. self::$stInstance = new LZRAccServer('racc');
  36. }
  37. return self::$stInstance;
  38. }
  39. function handle_req($file)
  40. {
  41. try
  42. {
  43. Log::record("file is {$file}",Log::DEBUG);
  44. if(file_exists($file))
  45. {
  46. if($this->is_exclude($file)) {
  47. Log::record("Call {$file}",Log::DEBUG);
  48. include $file;
  49. } else {
  50. Base::mobile_control();
  51. }
  52. }
  53. else
  54. {
  55. fcgi_header("Content-Type: text/html; charset=UTF-8");
  56. echo "no such file.";
  57. }
  58. }
  59. catch (LzException $ex) {
  60. echo ($ex->getMessage());
  61. }
  62. catch (Exception $ex) {
  63. $msg = "{$ex->getCode()}|{$ex->getMessage()}|";
  64. echo $msg;
  65. Log::record("run_looper exception catch code={$ex->getCode()} msg={$ex->getMessage()} trace={$ex->getTraceAsString()}",Log::ERR);
  66. }
  67. }
  68. }