In PECL, they somehow stopped supporting extensions for
libevent . In particular, libevent version 2 was not supported by either the
libevent extension of the same name, nor the
event extension (the last release was in 2004). Therefore, it was decided to rewrite the extension “event”, which had been lost since 2004.
Thus,
event is an old extension in a new guise:
- support of libevent 2.0.2-alpha and above, including HTTP server, Event Listener , DNS resolver and OpenSSL, as well as some functions of buffers and "buffer events" that were not available in previous versions
- new object oriented API
- ability to configure the necessary components (libevent_core, libevent_extra, libevent_pthreads, libevent_openssl) during installation
The transition to the OO API is due to the fact that the original names of the functions in libevent are not particularly beautiful:
')
bufferevent_setcb bufferevent_setwatermark bufferevent_socket_get_dns_error evbuffer_add_buffer evbuffer_get_contiguous_space
etc.
In addition, a member of the core PHP team, Johannes SchlĂĽter, assured that resources are practically no gains in performance compared to objects, and sometimes even lose. In general, recently there has been a tendency to move to objects.
Documentation
http://docs.php.net/manual/en/intro.event.php . Examples are there in the “Examples” section.
Installation
$ sudo pecl install event-beta
$ sudo pecl install event
The extension is being actively tested on Gentoo, Fedora, Ubuntu and FreeBSD.
While from time to time there is a need for corrections and additions, the code remains in the beta version.I hope it will be useful to someone.
Thank.
UPDATE
Stable release 1.5.0 is available.
PS
Used in the
phpDaemon project.