What is elephant.io?
Elephant.io provides a socket.io client fully written in PHP that should be usable everywhere in your project.
It is a light and easy to use library that aims to bring some real-time functionality to a PHP application through socket.io and websockets.
For elephant.io magic to operate, the following dependencies must be fulfilled:
- Socket.IO 0.8+
- PHP 5.3+
- NodeJS 0.6.5+
Example usage(Try out the demo)
In our case we have a Drupal site and one different site for example a simple .html site(it can be Drupal site as well)
The users are connected to this html site and listening to the changes from the Drupal site. From the Drupal site you want to notify the connected users if something happens on the Drupal backend. It can be basically everything (node update, order status change, content insert). When something occurs on the php side, you can simply notify the users on the html site with few lines of php code.
0, http://37.9.171.77:4000 --> change to the url where your socket is running
1, Install the module -> it will enable the Elephant IO library (you need to download the library and place it to sites/all/libraries/elephant.io folder
2, You need to have node and socket.io up and running