Home  >  Article  >  php教程  >  ucenter同步资料实时触发note

ucenter同步资料实时触发note

WBOY
WBOYOriginal
2016-06-06 20:14:00864browse

需求是这样的,shopnc和discuz通过ucenter已经实现了同步登陆,但是我们想在shopnc中修改了手机号码,同样将修改同步到discuz的个人联系资料中的手机号码。 二次开发的步骤按部就班,client.php,model的user.php和note.php,control中的user.php增加参数接

需求是这样的,shopnc和discuz通过ucenter已经实现了同步登陆,但是我们想在shopnc中修改了手机号码,同样将修改同步到discuz的个人联系资料中的手机号码。

二次开发的步骤按部就班,client.php,model的user.php和note.php,control中的user.php增加参数接口和配置等信息。

一顿修改之后,同步是可以实现了。但问题来了,这个同步并不是实时的,note会在下次应用连接ucenter的时候发送。

百度谷歌提供的资料几乎没有,我觉得很奇怪,这应该是经常碰到的需求。

下面讲下如何实现实时同步给所有应用你的修改。

在model的note.php中修改_send函数为

目的是遍历所有的应用,并且挨个发送修改手机号码的指令。

但是这样还是不够的,因为note.php原本是只发送给自己的,他写死了APPKEY,所以你的urlencode不会再别的应用被解析。

接下来修改文件get_url_code

这样就大功告成了。同样在别的应用中也需要做同样的修改才能实现实时同步哦!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn