如何在cakephp上实现Facebook的通知? [英] How to implement facebook like notification on cakephp?
问题描述
使用实时Web技术,如Comet服务器或WebSocket服务器。可以将此功能直接添加到PHP应用程序中,但广泛认为PHP不会很好地处理持久/长期连接(不会扩展)。如果您仍然希望托管自己的实时PHP解决方案,请点击以下资源:
然而,我会建议您查看托管解决方案(我工作一家这样的公司)这意味着您需要做的是对RESTful API进行HTTP调用,并在应用程序中嵌入JavaScript库以实现推送通知。更多信息为什么我建议在此 Apache和Comet中的SO问题
does somebody knows how to implement facebook like notification? the idea is to put notification on the tabs parallel to the changes made in the database without refreshing the site? if a data is added to the database, the site should react on it. thank you.. cheers!
Facebook style notifications are achieved in web applications using realtime web technologies such as Comet servers or WebSocket servers. It is possible to add this functionality directly into a PHP application but it's widely agreed that PHP doesn't handle persistent/long-held connections very well (it won't scale). If you still want to host your own realtime PHP solution here are a few resources:
- StackOverflow question about AJAX PHP Push
- phpwebsocket
- Start using HTML5 WebSockets today
- php-websocket
- How to implement Comet in PHP
However, I'd recommend you look at a hosted solution (I work for one such company) which means all you need to do is make a HTTP call to a RESTful API and embed a JavaScript library within your application to achieve your push notifications. More information why I recommend using a hosted service in this SO question on Apache and Comet
这篇关于如何在cakephp上实现Facebook的通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!