1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- define('BASE_ROOT_PATH',str_replace('\\','/',dirname(__FILE__)));
- define('MOBILE_SERVER',true);
- require_once (BASE_ROOT_PATH . '/fooder.php');
- function pays_execute($file)
- {
- static $exfiles = array('wxnotify.php','alipay_notify_url.php','dispatch_notify.php');
- $name = basename($file);
- return in_array($name,$exfiles);
- }
- function run_fcgi()
- {
- require_once(BASE_ROOT_PATH.'/mobile/index.php');
- Base::mobile_init();
- while(($ret = fcgi_accept()) >= 0)
- {
- ob_start();
- define('StartTime',microtime(true));
- define('TIMESTAMP',time());
- try
- {
- init_request();
- Log::record(request_helper::req_uri(),Log::DEBUG);
- $file = request_helper::script_file();
- if(file_exists($file))
- {
- if(pays_execute($file)) {
- echo("Content-Type: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8; charset=UTF-8\r\n\r\n");
- include $file;
- } else {
- echo("Content-Type: text/html; charset=UTF-8\r\n\r\n");
- Base::mobile_control();
- }
- }
- } catch (Exception $ex) {
- joutput_error($ex->getCode(),$ex->getMessage().'@@@@@'.$ex->getTraceAsString());
- }
- $contents = ob_get_clean();
- fcgi_echo($contents);
- Log::record($contents,Log::DEBUG);
- fcgi_finish();
- }
- fcgi_fini();
- }
- run_fcgi();
- ?>
|