Socket.IO with PHP + Zend Framework

625 views
Skip to first unread message

doomhz

unread,
Apr 17, 2011, 6:41:07 PM4/17/11
to Socket.IO
Hi,

Is it possible to communicate from frontend with Socket.IO to backend
that is built on PHP + Zend Framework?

Thank you.

rawberg

unread,
Apr 19, 2011, 3:52:22 AM4/19/11
to Socket.IO
Hey doomhz,

If your comfortable setting up your Zend Framework app to work from
the command line you could use <a href="http://nodejs.org/docs/v0.4.6/
api/child_processes.html#child_process.exec">child_process.exec()</a>
to pass input from Node app to your Zend Framework app. With that
setup your Node app continues humming along until the PHP app responds
by outputting data back to the command line. If you pass data back and
forth with JSON its pretty seem-less on both sides.

Another option would be to use a queuing system like <a href="https://
github.com/chrisboulton/php-resque">PHP-Rescue</a>. You could add jobs
directly to Redis from your NodeJS app and have the PHP-Resque jobs
talk to your Zend Framework app.

Hope that helps. Let us know how it goes.
Reply all
Reply to author
Forward
0 new messages