1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- namespace fcgisrv;
- 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_HELPER_PATH . '/fcgisrv/BaseServer.php');
- require_once(BASE_HELPER_PATH . '/refill/util.php');
- use Log;
- use Base;
- use UnSignException;
- use Exception;
- use merchantControl;
- use errcode;
- class VApiServer extends BaseServer
- {
- public function __construct($subPath)
- {
- parent::__construct($subPath);
- $exfiles = [
- ];
- $this->setExFiles($exfiles);
- }
- static private $stInstance = NULL;
- static public function instance()
- {
- if(self::$stInstance == NULL) {
- self::$stInstance = new VApiServer('vapi');
- }
- return self::$stInstance;
- }
- function handle_req($file)
- {
- try
- {
- Log::record("file is {$file}",Log::DEBUG);
- fcgi_header("Content-Type: text/html; charset=UTF-8");
- if(file_exists($file))
- {
- if($this->is_exclude($file)) {
- Log::record("Call {$file}",Log::DEBUG);
- include $file;
- } else {
- Base::mobile_control();
- }
- }
- else
- {
- echo "no such file.";
- }
- }
- catch (UnSignException $ex) {
- merchantControl::outerr(errcode::ErrUnLogin,errcode::msg(errcode::ErrUnLogin));
- }
- catch (Exception $ex) {
- merchantControl::outerr($ex->getCode(),$ex->getMessage());
- Log::record("run_looper exception catch code={$ex->getCode()} msg={$ex->getMessage()} trace={$ex->getTraceAsString()}",Log::ERR);
- }
- }
- }
|