1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?php
- namespace fcgisrv;
- require_once(BASE_HELPER_PATH . '/fcgisrv/BaseServer.php');
- require_once(BASE_HELPER_PATH . '/refill/util.php');
- require_once(BASE_ROOT_PATH . '/helper/area_helper.php');
- require_once(BASE_CORE_PATH . '/framework/function/http.php');
- require_once(BASE_ROOT_PATH . '/helper/session_helper.php');
- require_once(BASE_ROOT_PATH . '/helper/sensitive_word/dfa.php');
- require_once(BASE_ROOT_PATH . '/helper/exceptionex.php');
- require_once(BASE_PATH . '/control/merchant.php');
- require_once(BASE_PATH . '/control/lzbase.php');
- use Log;
- use Base;
- use Exception;
- use LzException;
- class LZRAccServer extends BaseServer
- {
- public function __construct($subPath)
- {
- parent::__construct($subPath);
- $exfiles = [
- 'callback/lingzh/baizeyd.php','callback/lingzh/aming.php' ,'callback/lingzh/binghc.php',
- 'callback/lingzh/ruishun.php','callback/lingzh/wuchen.php' ,'callback/lingzh/yibao.php',
- 'callback/lingzh/amingyd.php','callback/lingzh/chuka.php' ,'callback/lingzh/amingjd.php',
- 'callback/lingzh/legou.php' ,'callback/lingzh/feiniao.php','callback/lingzh/fensheng.php',
- 'callback/lingzh/riying.php' ,'callback/lingzh/wailing.php','callback/lingzh/weishengy.php',
- 'callback/lingzh/shengying.php','callback/lingzh/amingjdman.php','callback/lingzh/weishengywt.php',
- 'callback/lingzh/weishengyjd.php'
- ];
- $this->setExFiles($exfiles);
- }
- protected function is_exclude($file)
- {
- $ret = parent::is_exclude($file);
- if ($ret) {
- return true;
- } else {
- $path = BASE_ROOT_PATH . "/" . $this->mSubPath . "/callback/lingzh";
- $basename = basename($file);
- $tmp = "{$path}/{$basename}";
- return file_exists($tmp);
- }
- }
- static private $stInstance = NULL;
- static public function instance()
- {
- if(self::$stInstance == NULL) {
- self::$stInstance = new LZRAccServer('racc');
- }
- return self::$stInstance;
- }
- function handle_req($file)
- {
- try
- {
- Log::record("file is {$file}",Log::DEBUG);
- if(file_exists($file))
- {
- if($this->is_exclude($file)) {
- Log::record("Call {$file}",Log::DEBUG);
- include $file;
- } else {
- Base::mobile_control();
- }
- }
- else
- {
- fcgi_header("Content-Type: text/html; charset=UTF-8");
- echo "no such file.";
- }
- }
- catch (LzException $ex) {
- echo ($ex->getMessage());
- }
- catch (Exception $ex) {
- $msg = "{$ex->getCode()}|{$ex->getMessage()}|";
- echo $msg;
- Log::record("run_looper exception catch code={$ex->getCode()} msg={$ex->getMessage()} trace={$ex->getTraceAsString()}",Log::ERR);
- }
- }
- }
|