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


PHP WeUtility::createModuleProcessor方法代码示例

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


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

示例1: respond

	public function respond() {
		global $_W, $engine;
		$level = array();
		if (!empty($_W['account']['modules'])) {
			foreach ($_W['account']['modules'] as $row) {
				if (!empty($row['displayorder']) && $row['displayorder'] < 127) {
					$level[$row['displayorder']] = $row;
				}
			}
		}
		if (!empty($level)) {
			$response = '';
			for ($i = 1; $i <= 5; $i++) {
				if (!empty($response)) {
					$engine->response['module'] = $_W['module'];
					return $response;
					break;
				}
				if (empty($level[$i])) {
					continue;
				}
				$_W['module'] = $level[$i]['name'];
				$processor = WeUtility::createModuleProcessor($_W['module']);
				$processor->message = $this->message;
				$processor->inContext = false;
				$processor->rule = $this->rule;
				$engine->response['rule'] = $default['id'];
				$response = $processor->respond();
			}
		}
		if (!empty($_W['account']['default_period']) && empty($_W['cache']['default_period'])) {
			return;
		}
		$response['FromUserName'] = $this->message['to'];
		$response['ToUserName'] = $this->message['from'];
		$response['MsgType'] = 'text';
		$default = pdo_fetchcolumn("SELECT `default` FROM " . tablename('wechats') . " WHERE `weid`=:weid", array(':weid' => $_W['weid']));
		if (is_array(iunserializer($default))) {
			$default = iunserializer($default);
			$_W['module'] = $default['module'];
			$processor = WeUtility::createModuleProcessor($default['module']);
			$processor->message = $this->message;
			$processor->inContext = $this->inContext;
			$processor->rule = $default['id'];
			return $processor->respond();
		}
		$response['Content'] = stripslashes($default);
		return $response;
	}
开发者ID:royalwang,项目名称:saivi,代码行数:49,代码来源:processor.php

示例2: respond

 public function respond()
 {
     global $_W, $engine;
     $sql = "SELECT `welcome` FROM " . tablename('wechats') . " WHERE `weid`=:weid";
     $default = pdo_fetchcolumn($sql, array(':weid' => $_W['weid']));
     if (is_array(iunserializer($default))) {
         $default = iunserializer($default);
         $_W['module'] = $default['module'];
         $processor = WeUtility::createModuleProcessor($default['module']);
         $processor->message = $this->message;
         $processor->inContext = $this->inContext;
         $processor->rule = $default['id'];
         $processor->module = $_W['account']['modules'][$default['module']];
         $engine->response['rule'] = $default['id'];
         return $processor->respond();
     }
     return $this->respText($default);
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:18,代码来源:processor.php

示例3: process

 private function process($param)
 {
     global $_W;
     if (empty($param['module']) || !in_array($param['module'], $this->modules)) {
         return false;
     }
     $processor = WeUtility::createModuleProcessor($param['module']);
     $processor->message = $param['message'];
     $processor->rule = $param['rule'];
     $processor->priority = intval($param['priority']);
     $processor->inContext = $param['context'] === true;
     $response = $processor->respond();
     if (empty($response)) {
         return false;
     }
     return $response;
 }
开发者ID:ChainBoy,项目名称:wxfx,代码行数:17,代码来源:api.php

示例4: intval

    echo $exit;
    exit;
}
if ($do == 'end') {
    $fanid = intval($_GPC['fanid']);
    $fans = pdo_fetch('SELECT fanid,acid,openid FROM ' . tablename('mc_mapping_fans') . ' WHERE uniacid = :uniacid AND fanid = :id', array(':uniacid' => $_W['uniacid'], ':id' => $fanid));
    $account = account_fetch($fans['acid']);
    $message['from'] = $_W['openid'] = $fans['openid'];
    $message['to'] = $account['original'];
    if (!empty($message['to'])) {
        $sessionid = md5($message['from'] . $message['to'] . $_W['uniacid']);
        load()->classs('wesession');
        load()->classs('account');
        session_id($sessionid);
        WeSession::start($_W['uniacid'], $_W['openid'], 300);
        $processor = WeUtility::createModuleProcessor('chats');
        $processor->end();
    }
    if (!empty($_GPC['from'])) {
        $url = base64_decode($_GPC['from']);
    } else {
        $url = url('mc/fans/', array('acid' => $fans['acid']));
    }
    header('Location:' . $url);
    exit;
}
function iurldecode($str)
{
    if (!is_array($str)) {
        return urldecode($str);
    }
开发者ID:nsoff,项目名称:wdlcms,代码行数:31,代码来源:notice.ctrl.php

示例5: runhook

/**
 * 运行模块勾子
 * @param string $hookname
 */
function runhook($hookname) {
	global $_W;
	$hooks = $_W['cache']['hooks'][$_W['weid']];
	if (empty($hooks)) {
		cache_build_hook($_W['uid']);
		$hooks = cache_load("hooks:{$_W['weid']}");
	}
	if (!empty($hooks[$hookname])) {
		foreach ($hooks[$hookname] as $hook) {
			$hookobj = WeUtility::createModuleProcessor($hook[0]);
			if (method_exists($hookobj, $hook[1])) {
				call_user_func(array($hookobj, $hook[1]));
			}
		}
	}
}
开发者ID:royalwang,项目名称:saivi,代码行数:20,代码来源:global.func.php

示例6: doWebPreview

 public function doWebPreview()
 {
     //'from_user' => base64_encode(authcode("fromuser", 'ENCODE'))
     $url = create_url('mobile/module', array('name' => 'shopping3', 'do' => 'wlhome', 'weid' => $GLOBALS['_W']['weid']));
     $processor = WeUtility::createModuleProcessor($this->module['name']);
     $url = $processor->index();
     header('Location: ' . $url);
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:8,代码来源:site.php

示例7: respond

 public function respond()
 {
     global $_W, $engine;
     $level = array();
     if (!empty($_W['account']['modules'])) {
         foreach ($_W['account']['modules'] as $row) {
             if (!empty($row['displayorder']) && $row['displayorder'] < 127) {
                 $level[$row['displayorder']] = $row;
             }
         }
     }
     if (!empty($level)) {
         $response = '';
         for ($i = 1; $i <= 5; $i++) {
             if (!empty($response)) {
                 $engine->response['module'] = $_W['module'];
                 return $response;
                 break;
             }
             if (empty($level[$i])) {
                 continue;
             }
             $_W['module'] = $level[$i]['name'];
             $processor = WeUtility::createModuleProcessor($_W['module']);
             $processor->message = $this->message;
             $processor->inContext = false;
             $processor->rule = $this->rule;
             $engine->response['rule'] = $default['id'];
             $processor->module = $_W['account']['modules'][$_W['module']];
             $response = $processor->respond();
         }
     }
     if (!empty($_W['account']['default_period'])) {
         $_W['cache']['default_period'] = TRUE;
         $row = pdo_fetch("SELECT id, lastupdate FROM " . tablename('default_reply_log') . " WHERE from_user = '{$this->message['from']}' AND weid = '{$_W['weid']}'");
         if (!empty($row)) {
             if (TIMESTAMP - intval($row['lastupdate']) > intval($_W['account']['default_period'])) {
                 $_W['cache']['default_period'] = TRUE;
             } else {
                 $_W['cache']['default_period'] = FALSE;
             }
         }
         if (!empty($row)) {
             pdo_update('default_reply_log', array('lastupdate' => TIMESTAMP), array('id' => $row['id']));
         } else {
             pdo_insert('default_reply_log', array('from_user' => $this->message['from'], 'lastupdate' => TIMESTAMP, 'weid' => $_W['weid']));
         }
     }
     if (!empty($_W['account']['default_period']) && empty($_W['cache']['default_period'])) {
         return;
     }
     $default = pdo_fetchcolumn("SELECT `default` FROM " . tablename('wechats') . " WHERE `weid`=:weid", array(':weid' => $_W['weid']));
     if (is_array(iunserializer($default))) {
         $default = iunserializer($default);
         $_W['module'] = $default['module'];
         $processor = WeUtility::createModuleProcessor($default['module']);
         $processor->message = $this->message;
         $processor->inContext = $this->inContext;
         $processor->rule = $default['id'];
         $processor->module = $_W['account']['modules'][$default['module']];
         return $processor->respond();
     }
     return $this->respText($default);
 }
开发者ID:yunsite,项目名称:my-we7,代码行数:64,代码来源:processor.php

示例8: process

	private function process() {
		$response = false;
		if (empty($this->response['module']) || !in_array($this->response['module'], $this->modules)) {
			return false;
		}
		$processor = WeUtility::createModuleProcessor($this->response['module']);
		$processor->message = $this->message;
		$processor->rule = $this->response['rule'];
		$response = $processor->respond();
		if(empty($response)) {
			return false;
		}
		return $response;
	}
开发者ID:royalwang,项目名称:saivi,代码行数:14,代码来源:engine.php


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