netputer / wechat-php-sdk

微信公众平台 PHP SDK
MIT License
679 stars 351 forks source link

微信开发公共变量问题 #3

Closed taurushz closed 11 years ago

taurushz commented 11 years ago

你好,我用你的sae框架开发微信的程序 我设置了一个公共变量$hotourl 我想实现用户先发送照片 并存储这个照片地址 所以我在onImage里面 给这个公共变量赋值 然后当我在ontext也就是当用户下次发送文字信息时 我想检测这个变量是否赋值 然后回复消息

现在的问题是在发送图片后再发送信息 没有检测到变量被赋值 这怎么解决

netputer commented 11 years ago

PHP 变量的生命周期是一个请求的时间,而你 onImageonText 就是两次请求啦,直接用变量是无法保存信息的。建议使用 KVDB 或 Memcache 。

taurushz commented 11 years ago

$this->responseText 这个函数是否会终止整个请求, 我每次如果把这个放到前面 ,发现后面的语句都不执行了

netputer commented 11 years ago

是的,要先接收信息,再发送信息。

发自我的 iPhone

在 2013-7-11,2:52,taurushz notifications@github.com 写道:

$this->responseText 这个函数是否会终止整个请求, 我每次如果把这个放到前面 ,发现后面的语句都不执行了

— Reply to this email directly or view it on GitHubhttps://github.com/netputer/wechat-php-sdk/issues/3#issuecomment-20763986 .

taurushz commented 11 years ago

还有个问题,这个框架里面有群发信息的功能吗? 就是推送

taurushz commented 11 years ago

请问你有QQ不 有问题好及时请教你 如果可以请发到我的邮箱 taurushz@gmail.com

netputer commented 11 years ago

没有,微信官方没有提供这样的接口。如有需要,可以参考 Github 上其它类似的项目,有的通过特殊方法已经实现了。

QQ 嘛,最近都在外面,不常上线,还请在 Github 里说吧。

发自我的 iPhone

在 2013-7-11,14:03,taurushz notifications@github.com 写道:

还有个问题,这个框架里面有群发信息的功能吗? 就是推送

— Reply to this email directly or view it on GitHubhttps://github.com/netputer/wechat-php-sdk/issues/3#issuecomment-20792003 .

taurushz commented 11 years ago

那如果我有用户的id能否发送特定消息给用户?

netputer commented 11 years ago

也不行,没有相关的接口。

发自我的 iPhone

在 2013-7-11,14:39,taurushz notifications@github.com 写道:

那如果我有用户的id能否发送特定消息给用户?

— Reply to this email directly or view it on GitHubhttps://github.com/netputer/wechat-php-sdk/issues/3#issuecomment-20792980 .