当前位置: 首页>>代码示例>>PHP>>正文


PHP WeUtility::createModuleReceiver方法代码示例

本文整理汇总了PHP中WeUtility::createModuleReceiver方法的典型用法代码示例。如果您正苦于以下问题:PHP WeUtility::createModuleReceiver方法的具体用法?PHP WeUtility::createModuleReceiver怎么用?PHP WeUtility::createModuleReceiver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WeUtility的用法示例。


在下文中一共展示了WeUtility::createModuleReceiver方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: receive

 private function receive($par, $keyword, $response)
 {
     global $_W;
     if (in_array($this->message['event'], array('subscribe', 'unsubscribe')) || in_array($this->message['type'], array('subscribe', 'unsubscribe'))) {
         $modules = uni_modules();
         $core = array();
         $core['name'] = 'core';
         $core['subscribes'] = array('core');
         array_unshift($modules, $core);
         foreach ($modules as $m) {
             if (!empty($m['subscribes'])) {
                 if ($m['name'] == 'core' || in_array($this->message['type'], $m['subscribes']) || in_array($this->message['event'], $m['subscribes'])) {
                     $obj = WeUtility::createModuleReceiver($m['name']);
                     $obj->message = $this->message;
                     $obj->params = $par;
                     $obj->response = $response;
                     $obj->keyword = $keyword;
                     $obj->module = $m;
                     $obj->uniacid = $_W['uniacid'];
                     $obj->acid = $_W['acid'];
                     if (method_exists($obj, 'receive')) {
                         @$obj->receive();
                     }
                 }
             }
         }
     } else {
         $row = array();
         $row['uniacid'] = $_W['uniacid'];
         $row['acid'] = $_W['acid'];
         $row['dateline'] = $par['message']['time'];
         $row['message'] = iserializer($par['message']);
         $row['keyword'] = iserializer($keyword);
         unset($par['message']);
         unset($par['keyword']);
         $row['params'] = iserializer($par);
         $row['response'] = iserializer($response);
         $row['module'] = $par['module'];
         $row['type'] = 1;
         pdo_insert('core_queue', $row);
     }
 }
开发者ID:ChainBoy,项目名称:wxfx,代码行数:42,代码来源:api.php

示例2: ext_module_msg_types

                    $module_subscribes[$module['name']] = $module['subscribes'];
                }
            }
        }
    }
    $mtypes = ext_module_msg_types();
    $module_ban = $_W['setting']['module_receive_ban'];
    if (!is_array($module_ban)) {
        $module_ban = array();
    }
    template('extension/subscribe');
}
if ($do == 'check') {
    load()->classs('account');
    $modulename = $_GPC['modulename'];
    $obj = WeUtility::createModuleReceiver($modulename);
    if (empty($obj)) {
        exit('error');
    }
    $obj->uniacid = $_W['uniacid'];
    $obj->acid = $_W['acid'];
    if (method_exists($obj, 'receive')) {
        @$obj->receive();
        exit('success');
    }
}
if ($do == 'ban') {
    $modulename = $_GPC['modulename'];
    $ban = $_GPC['ban'];
    if (empty($modulename)) {
        message('请设置模块名', referer(), 'error');
开发者ID:aspnmy,项目名称:weizan,代码行数:31,代码来源:subscribe.ctrl.php

示例3: iunserializer

            $message['keyword'] = iunserializer($message['keyword']);
            $qids .= $message['qid'] . ',';
        }
        $qids = trim($qids, ',');
        $sql = 'DELETE FROM ' . tablename('core_queue') . " WHERE `qid` IN ({$qids})";
        pdo_query($sql);
        load()->model('module');
        $modules = uni_modules();
        $core = array();
        $core['name'] = 'core';
        $core['subscribes'] = array('core');
        array_unshift($modules, $core);
        foreach ($messages as $msg) {
            foreach ($modules as $m) {
                if (!empty($m['subscribes'])) {
                    if ($m['name'] == 'core' || in_array($msg['message']['type'], $m['subscribes'])) {
                        $obj = WeUtility::createModuleReceiver($m['name']);
                        $obj->message = $msg['message'];
                        $obj->params = $msg['params'];
                        $obj->response = $msg['response'];
                        $obj->keyword = $msg['keyword'];
                        $obj->module = $m;
                        if (method_exists($obj, 'receive')) {
                            $obj->receive();
                        }
                    }
                }
            }
        }
    }
}
开发者ID:hahamy,项目名称:we7,代码行数:31,代码来源:subscribe.ctrl.php

示例4: receive

 private function receive($par, $keyword, $response)
 {
     global $_W;
     $subscribe = cache_load('module_receive_enable');
     $modules = uni_modules();
     $obj = WeUtility::createModuleReceiver('core');
     $obj->message = $this->message;
     $obj->params = $par;
     $obj->response = $response;
     $obj->keyword = $keyword;
     $obj->module = 'core';
     $obj->uniacid = $_W['uniacid'];
     $obj->acid = $_W['acid'];
     if (method_exists($obj, 'receive')) {
         @$obj->receive();
     }
     if (!empty($subscribe['subscribe']) && ($this->message['event'] == 'subscribe' || $this->message['type'] == 'subscribe')) {
         foreach ($subscribe['subscribe'] as $modulename) {
             $obj = WeUtility::createModuleReceiver($modulename);
             $obj->message = $this->message;
             $obj->params = $par;
             $obj->response = $response;
             $obj->keyword = $keyword;
             $obj->module = $modules[$modulename];
             $obj->uniacid = $_W['uniacid'];
             $obj->acid = $_W['acid'];
             if (method_exists($obj, 'receive')) {
                 @$obj->receive();
             }
         }
     } elseif (!empty($subscribe['unsubscribe']) && ($this->message['event'] == 'unsubscribe' || $this->message['type'] == 'unsubscribe')) {
         foreach ($subscribe['unsubscribe'] as $modulename) {
             $obj = WeUtility::createModuleReceiver($modulename);
             $obj->message = $this->message;
             $obj->params = $par;
             $obj->response = $response;
             $obj->keyword = $keyword;
             $obj->module = $modules[$modulename];
             $obj->uniacid = $_W['uniacid'];
             $obj->acid = $_W['acid'];
             if (method_exists($obj, 'receive')) {
                 @$obj->receive();
             }
         }
     } else {
         $modules = $subscribe[$this->message['type']];
         if (!empty($modules)) {
             foreach ($modules as $modulename) {
                 $row = array();
                 $row['uniacid'] = $_W['uniacid'];
                 $row['acid'] = $_W['acid'];
                 $row['dateline'] = $_W['timestamp'];
                 $row['message'] = iserializer($this->message);
                 $row['keyword'] = iserializer($keyword);
                 $row['params'] = iserializer($par);
                 $row['response'] = iserializer($response);
                 $row['module'] = $modulename;
                 $row['type'] = 1;
                 pdo_insert('core_queue', $row);
             }
         }
         if (date('N') == '1') {
             pdo_query("DELETE FROM " . tablename('core_queue') . " WHERE dateline < '" . ($_W['timestamp'] - 2592000) . "'");
         }
     }
 }
开发者ID:wisemyth,项目名称:weizan,代码行数:66,代码来源:api.php

示例5: subscribe

 private function subscribe($subscribes)
 {
     global $_W;
     foreach ($subscribes as $m) {
         $obj = WeUtility::createModuleReceiver($m['name']);
         $obj->message = $this->message;
         $obj->params = $this->params;
         $obj->response = $this->response;
         $obj->keyword = $this->keyword;
         $obj->module = $m;
         if (method_exists($obj, 'receive')) {
             $obj->receive();
         }
     }
 }
开发者ID:yunsite,项目名称:my-we7,代码行数:15,代码来源:engine.php


注:本文中的WeUtility::createModuleReceiver方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。