Swoole-1.8.6 has been released to fix PHP7 related issues 1.8.6 version is an important BUG fix version, it mainly fixes memory leaks and crashes in clients such as HttpServer, TCPClient, HttpClient, and Redis in the PHP7 environment. In addition, MySQL 1.8.6 is completely reconstructed and provides a brand new object-oriented API that completely removes the dependency on PHP mysqli and mysqlnd.
We recommend that all swoole developers upgrade to this version.
Main updates
-
Fixed the error in changing the zval type when the Value of the Swoole \ Server-> set method in the correlated index array is NULL.
-
Update the third parameter of the Swoole \ Server-> task method. you can directly input the callback function.
-
Resolved the problem that Swoole \ WebSocket \ Server crashed when receiving malicious requests to improve stability.
-
Restructured the Swoole \ MySQL client, removed the dependency on mysqli and mysqlnd, and provided an object-oriented API
-
Set Swoole \ Http \ Client to built-in, and no additional compilation parameters are required.
-
Adjust the memory recovery time of Swoole \ Client and Swoole \ Http \ Client, and reclaim memory resources when the connection is closed
-
Added the cache for swoole_async_dns_lookup query results.
-
Optimizes the performance of Swoole \ WebSocket \ Server and reduces memory replication twice.
-
Remove Swoole \ Http \ Server-> setGlobal method
-
Fixed the problem where the onClose callback function was not executed in the Worker process when the close operation was executed in the Task process.
-
Fixed the problem where data was not cleared after Swoole \ Table deleted the KEY.
-
Added support for SSL and TLS certificate chains
-
Remove gcc aio
-
Fixed problems related to asynchronous file read/write functions.
New MySQL asynchronous client
$db = new swoole_mysql;$server = array( 'host' => '192.168.56.102', 'user' => 'test', 'password' => 'test', 'database' => 'test',);$db->connect($server, function ($db, $r) { if ($r === false) { var_dump($db->connect_errno, $db->connect_error); die; } $sql = 'show tables'; $db->query($sql, function(swoole_mysql $db, $r) { global $s; if ($r === false) { var_dump($db->error, $db->errno); } elseif ($r === true ) { var_dump($db->affected_rows, $db->insert_id); } var_dump($r); $db->close(); });});