本文整理汇总了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);
}
}
示例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');
示例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();
}
}
}
}
}
}
}
示例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) . "'");
}
}
}
示例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();
}
}
}