+ Start a Discussion
VahidVahid 

Streaming API to work with PHP?

Has anyone been able to get the streaming API to work with PHP? 

sammydsammyd

look like this references how to do connect/subscribe and handle events with cometd and PHP

 

http://www.slideshare.net/kingfoo/implementing-comet-using-php

 

 

gwestrgwestr

Hi Vahid,

 

If you just want streaming to work in a user's browser, you can use Javascript and cometd.js.  It doesn't matter if your website is static HTML or a dynamic language like PHP, Visualforce, Java Servlets, Ruby.  Just include a script tag for cometd on every page you want to streaming enable.  Javascript is adept at parsing the JSON messages from the streaming API, and updating the DOM so the user sees the refreshed data.

 

Is that the case, or do you want your PHP to parse and store the streaming data?

Mostafa Hamid 1Mostafa Hamid 1
Here is a streaming API that works:

https://github.com/advisors-excel-llc/salesforce-rest-sdk