Swoole-1.8.1 has been released, add PSR-4 namespace class name swoole-1.8.1 version has been released, this version is a BUG fix version, mainly fix some bugs in version 1.8.0, in addition to version 1.8.1
Added the PSR-4 namespace style class name.
Namespace example:
To use the namespace class style, modify php. ini and enable swoole. use_namespace = On. After the namespace class name is used, old-style class names are unavailable.
use Swoole\Http\Server;use Swoole\Http\Request;use Swoole\Http\Response;$serv = new Server('127.0.0.1', 9501);$serv->on('Request', function(Request $req, Response $resp) { var_dump($req->header, get_class($req)); $resp->end("Hello Swoole");});$serv->start();
Major updates:
-
Add the namespace alias of the core class
-
Added the swoole_server-> protect method to protect some connections from being cut off by heartbeat threads.
-
Added swoole_websocker_server: pack and swoole_websocker_server: unpack static methods for manually packaging/unpackaging websocket data frames
-
Fixed the issue that the standard output of log printing is disabled and the SIGPIPE signal is generated continuously, resulting in an endless loop.
-
Fixed openssl compilation failure in the MacOS environment.
-
Added support for redis message subscription and publishing
-
Solved the problem of core dump in multi-port listening when no listener Port callback is set.
-
Fixed the memory leakage problem of asynchronous Client.
-
Fixed the problem where asynchronous Client is disabled in other event callback functions and core dump occurs occasionally.
-
Added support for gzip content compression by swoole_http_client.
:
-
GITHUB: https://github.com/swoole/swoole-src/releases/tag/swoole-1.8.1-stable
-
Open source China: http://git.oschina.net/matyhtf/swoole/tree/swoole-1.8.1-stable
-
PECL: https://pecl.php.net/package/swoole/1.8.1