I am learning WebSockets, and my preferred language is PHP. Naturally I chose to go with the Ratchet library to build my WebSocket servers. So far I've been fairly impressed with the simplicity of Ratchet, but I'm confused about a PECL extension that they recommend here. They say to install libevent (done) and then install PECL libevent. I was a bit confused as several people have had success with
PECL install libevent
but this gives me an erorr, stating that only a beta version is avaiable. Weary to install beta software on what may very well become a production solution, I happend across another PECL extension, called event.
The PECL extension 'event' explicitly states that it "Provides interface to libevent library...for PHP". I'm wondering if I install and enable the "event" extension, if it will work in place of libevent.
Does anyone know if the 'event' php extension will work in place of the 'libevent' php extension, in regards to Ratchet?
Maybe.
PECL libevent does not seem to be actively maintained anymore, so, to me, it looks like Ratchet should consider providing support for the PECL event extension, instead of the apparently out-of-date PECL libevent extension.
Unfortunately their APIs are not compatible, because PECL event went for an OO API, so, unless there's explicit support for the PECL event API in Ratchet, you're out of luck with that one.
EDIT
Looks like Ratchet uses React, which does provide an adapter for PECL event.
Re "beta", you can still install it with $ pecl install libevent-beta
, but I actually doubt, considering the date of the latest release, that it would even build for a current PHP version.