V
V
Vitali2011-04-17 18:48:10
PHP
Vitali, 2011-04-17 18:48:10

XMPP and receiving messages through PHP?

Sat down with friends to write a small project in PHP. It was necessary to completely limit all communication within the site, we decided to take the Openfire XMPP server as a basis, it was successfully installed and works well now and everything seemed to be fine until I started integrating it with PHP.
Everything is clear with sending messages, XMPPHP does a good job here, but how you can receive messages sent to a particular user in real time remains a mystery to me.
Maybe the habravchans have thoughts on how this can be implemented using PHP?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
addfs, 2011-04-17
@addfs

Several options, periodically poll openfire for messages for the user, or use the strophejs library, which uses BOSH and long polling.

K
kill_windows, 2014-09-13
@kill_windows

And to this day, for js, strophejs remains the most normal library, and nothing really has been written for php. Jaxl - the scope was large, but it was never brought to mind, there is no documentation, the raw and complex code of the library itself, there are examples but they do not work, maintenance ended many years ago. XMPPHP - not as functional as Jaxl, no documentation, no examples, last updates were sooo long ago. jabber.class.php - sharpened for php4, that's it.
And besides all this, according to xmpp, apart from the official list of XEP documents, there is practically nothing intelligible. There are a couple of ancient books and those in English, some blogs, etc.

E
ertaquo, 2011-04-17
@ertaquo

And if to try Jaxl ? It seems to be able to receive messages, storing them in the MySQL database and calling callbacks. Minus - the lack of normal documentation and examples =\

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question