瀏覽代碼

replace fcgi_echo to echo

stanley-king 9 年之前
父節點
當前提交
0e3c773f67
共有 7 個文件被更改,包括 22 次插入17 次删除
  1. 2 5
      core/framework/libraries/sms.php
  2. 10 3
      fcgi_run.php
  3. 2 2
      mobile/framework/function/function.php
  4. 3 3
      mobile/wxnotify.php
  5. 2 2
      research/research_run.php
  6. 1 1
      research/sms_test.php
  7. 2 1
      run.php

+ 2 - 5
core/framework/libraries/sms.php

@@ -67,11 +67,8 @@ class Sms {
         $time = $content['time'];
         $type = $content['type'];
 
-        return send_msg($mobile);
-
-
-
-    }
+        return $this->send_msg($mobile,$code,$type,$time);
+	}
 
     /*
 	您于{$send_time}绑定手机号,验证码是:{$verify_code}。【{$site_name}】

+ 10 - 3
fcgi_run.php

@@ -19,7 +19,9 @@ function run_fcgi()
     Base::mobile_init();
 
     while(($ret = fcgi_accept()) >= 0)
-    {    
+    {
+        ob_start();
+
         define('StartTime',microtime(true));
         define('TIMESTAMP',time());
 
@@ -30,16 +32,21 @@ function run_fcgi()
             if(file_exists($file))
             {
                 if(pays_execute($file)) {
-                    fcgi_echo("Content-Type: application/xml; charset=UTF-8\r\n\r\n");
+                    echo("Content-Type: application/xml; charset=UTF-8\r\n\r\n");
                     require $file;
                 } else {
-                    fcgi_echo("Content-Type: text/html; charset=UTF-8\r\n\r\n");
+                    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_contents();
+        fcgi_echo($contents);
+        ob_end_clean();
+
         fcgi_finish();
     }
     

+ 2 - 2
mobile/framework/function/function.php

@@ -44,7 +44,7 @@ function joutput_data($datas)
     $data['message'] = errcode::msg($code);
     $data['datas'] = $datas;
 
-    fcgi_echo(json_encode($data));
+    echo(json_encode($data));
 }
 
 function joutput_error($code,$message = '') 
@@ -58,7 +58,7 @@ function joutput_error($code,$message = '')
     $data['message'] =  $message;
     $data['datas'] = null;
 
-    fcgi_echo(json_encode($data));
+    echo(json_encode($data));
 }
 
 function mobile_page($page_count) 

+ 3 - 3
mobile/wxnotify.php

@@ -19,13 +19,13 @@ require_once (WXPAY_PATH . '/lib/WxPay.Notify.php');
 
 //初始化日志
 $log_path = BASE_ROOT_PATH . "/logs/wx-".date('Y-m-d').'.log';
-fcgi_echo($log_path);
+echo($log_path);
 $logHandler= new CLogFileHandler(BASE_ROOT_PATH . "/logs/wx-".date('Y-m-d').'.log');
 $log = wxLog::Init($logHandler, 15);
 
 if(empty($log))
 {
-    fcgi_echo('open file error <br>');
+    echo('open file error <br>');
 }
 
 
@@ -82,7 +82,7 @@ try {
 
     wxLog::DEBUG($xml);
 
-    fcgi_echo($xml);
+    echo($xml);
 } catch (WxPayException $e){
     $msg = $e->errorMessage();
     return false;

+ 2 - 2
research/research_run.php

@@ -10,8 +10,8 @@ Base::run_test();
 
 //include BASE_ROOT_PATH . "/research/db.php";
 //include BASE_ROOT_PATH . "/research/function_test.php";
-//include BASE_ROOT_PATH . "/research/sms_test.php";
-include BASE_ROOT_PATH . "/research/wxpay.php";
+include BASE_ROOT_PATH . "/research/sms_test.php";
+//include BASE_ROOT_PATH . "/research/wxpay.php";
 
 
 

+ 1 - 1
research/sms_test.php

@@ -11,6 +11,6 @@ function getcode()
 
 $code = getcode();
 $sms = new Sms();
-$sms->send('13911129867', "9867");
+$sms->send('13003290793', array('code' =>"9867",'time' => "5", "type" => '1'));
 
 

+ 2 - 1
run.php

@@ -4,7 +4,7 @@
 define('BASE_ROOT_PATH',str_replace('\\','/',dirname(__FILE__)));
 
 require_once (BASE_ROOT_PATH . '/fooder.php');
-$gfcgi_run = 2;
+$gfcgi_run = 1;
 
 if($gfcgi_run == 0) { //模拟请求
     $file = BASE_ROOT_PATH . '/debug_run.php';
@@ -23,3 +23,4 @@ if($gfcgi_run == 0) { //模拟请求
 }
 ?>
 
+