3 Feb 2012 9:22 AM #1
Implementation COMET in PHP Using Prototype JS and ExtJS
I would like a recommendation or an example regarding the implementation of Prototype JS with ExtJS 3.3.0 in order to create a Web Application that uses COMET with PHP.
I've developed a Web Application that currently handles PHP Sessions in order to control how many users are logged in the system.
Some users and co-workers have given me some suggestions about clearing user sessions by closing the browser (clicking on the "X") since I have experienced a couple of minor inconveniences with users not finishing their sessions correctly.
I found out a thread response from DaniWeb (http://www.daniweb.com/web-developme...966#post663966) advising the use of COMET.
After reading this response I was able to get an example that uses COMET with PHP using AJAX in order to create a little chat ( http://www.zeitoun.net/articles/comet_and_php/start ). The example uses Prototype JS to establish a communication interface by creating a simple form and having a PHP loop procedure running indefinitely during the whole page load. If you download the sample code and run it in Firefox, you can activate Firebug to confirm the continuous connection to the php script.
Since ExtJS 3.3.0 offers a way to use other JS libraries like Prototype, does anyone can provide me an example or sample code that I can use as a reference to combine both libraries in order to implement COMET?
Any advice or recommendation will be well appreciated.
3 Feb 2012 9:26 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
You would have to create an adapter much like there is one for jquery. Make sure you actually need to use COMETMitchell Simoens @LikelyMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
3 Feb 2012 9:38 AM #3
Actually the ExtJS Library that I downloaded includes adapter for jQuery and Prototype. However the examples provided do not include samples using those adapters.
Which other solution would you recommend besides COMET?