Browse Source

fix cannot receive publish

stanley-king 7 years ago
parent
commit
8c85adc347
7 changed files with 6 additions and 70 deletions
  1. 0 43
      debug_run.php
  2. 0 1
      fcgi_run.php
  3. 4 5
      helper/message/msgutil.php
  4. 1 0
      helper/message/publisher.php
  5. 1 1
      helper/message/subscriber.php
  6. 0 13
      info.php
  7. 0 7
      placeholder.php

+ 0 - 43
debug_run.php

@@ -1,43 +0,0 @@
-<?php
-
-printf("Content-Type: text/html; charset=UTF-8\r\n\r\n");
-
-$reqs = array();
-//$reqs['index'] = 'http://localhost:8080/';
-//$reqs['index'] ='http://localhost:8080/mobile/index.php?act=index&op=index';
-//$reqs['login_register'] ='http://localhost:8080/mobile/index.php?act=login&op=register&username=stanley&password=55668899&password_confirm=55668899';
-
-//$reqs['login_genanonymous'] ='http://localhost:.
-//mobile/index.php?act=login&op=genuser&info=helloworld&type=1&client=android';
-//$reqs['login_genwx'] ='http://localhost:8080/mobile/index.php?act=login&op=genuser&type=2&openid=123456789000&client=android';
-
-//$reqs['login_anonymous_login'] ='http://localhost:8080/mobile/index.php?act=login&op=login&openid=561f708422817&type=1&client=android';
-//$reqs['login_wx_login'] ='http://localhost:8080/mobile/index.php?act=login&op=login&openid=123456789000&type=2&client=android';
-//$reqs['login_mobile_login'] ='http://localhost:8080/mobile/index.php?act=login&op=login&mobile=18022196345&password=55668899&type=0&client=android';
-
-
-//$reqs['login_wx_getinfo'] ='http://localhost:8080/mobile/index.php?act=login&op=getinfo&token=08a6a71c051bc5be33f85141f3ca6b52';
-
-//$reqs['login_wx_getcode'] ='http://localhost:8080/mobile/index.php?act=login&op=getcode&token=fe22e0bc1c2e776b3dc22374fc96b0af&mobile=13911129867';
-//$reqs['login_wx_checkcode'] ='http://localhost:8080/mobile/index.php?act=login&op=checkcode&token=08a6a71c051bc5be33f85141f3ca6b52&code=0369';
-
-//$reqs['login_wx_bind'] ='http://localhost:8080/mobile/index.php?act=login&op=bind&token=fe22e0bc1c2e776b3dc22374fc96b0af&code=2578&password=55668899&type=mobile';
-
-$reqs['login_wx_bind'] = 'http://localhost/mobile/index.php?act=goods&op=goods_list&page=10&curpage=1';
-
-
-foreach ($reqs as $key => $uri)
-{    
-    define('StartTime', microtime(true));
-    define('TIMESTAMP', time());
-    
-    $lreq = new local_request($uri);    
-    init_localreq($lreq); 
-   
-    $file = $lreq->script_file(); 
-    if(is_file($file)) {
-        include $file;
-    } else {
-        echo 'no such file';
-    }
-}

+ 0 - 1
fcgi_run.php

@@ -13,7 +13,6 @@ require_once (BASE_ROOT_PATH . '/helper/message/msgutil.php');
 require_once (BASE_ROOT_PATH . '/helper/message/subscriber.php');
 require_once (BASE_ROOT_PATH . '/helper/index_tab.php');
 
-
 function all_channels()
 {
     return array('ch_index','activity','goods');

+ 4 - 5
helper/message/msgutil.php

@@ -61,7 +61,6 @@ class StatesHelper
         }
     }
 
-
     static public function onSearcher($states,$msg)
     {
         $type = $msg['type'];
@@ -112,7 +111,7 @@ class StatesHelper
 
 function handler_redis($redis, $chan, $msg)
 {
-    if (UGC_SUBSCRIBER_PROC)
+    if (defined(UGC_SUBSCRIBER_PROC) && UGC_SUBSCRIBER_PROC == true)
     {
         if($chan == 'special') {
             UgcHandler::onSpecial($msg);
@@ -120,11 +119,11 @@ function handler_redis($redis, $chan, $msg)
         elseif($chan == 'fellow') {
             UgcHandler::onFellow($msg);
         } else {
-
+            Log::record("message: {$chan} -- {$msg}",Log::DEBUG);
         }
     }
-    else {
-        Log::record("message: {$chan} -- {$msg}",Log::INFO);
+    else
+    {
         $cur_trd = Thread::getCurrentThread();
         $cur_trd->dispatch($chan,$msg);
     }

+ 1 - 0
helper/message/publisher.php

@@ -16,6 +16,7 @@ class publisher
     private $mConfig;
     private $mRedis;
     private $mConnected;
+
     public function __construct()
     {
         $this->mConfig = C('redis');

+ 1 - 1
helper/message/subscriber.php

@@ -61,7 +61,7 @@ class subscriber extends Thread
 
     protected function dispatch($channel,$msg)
     {
-        Log::record("ch={$channel} msg={$msg}",Log::DEBUG);
+        Log::record("subscriber dispatch ch={$channel} msg={$msg}",Log::DEBUG);
 
         if(empty($msg)) return false;
         $msg = unserialize($msg);

+ 0 - 13
info.php

@@ -1,13 +0,0 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: stanley-king
- * Date: 16/1/4
- * Time: 下午12:04
- */
-
-
-
-phpinfo();
-
-

+ 0 - 7
placeholder.php

@@ -1,7 +0,0 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: huanggang
- * Date: 17/3/7
- * Time: 18:12
- */