From 738259c69f0ed424523b2fa7f72c312462d225e3 Mon Sep 17 00:00:00 2001 From: Demin Yin Date: Wed, 4 Oct 2023 21:22:35 -0700 Subject: [PATCH] add new changes in Swoole 5.1.0 Signed-off-by: Demin Yin --- src/swoole/Swoole/Coroutine/Http/Server.php | 7 ++++++- src/swoole/Swoole/Coroutine/Socket.php | 10 ++++++++++ src/swoole/Swoole/Http2/Request.php | 5 +++++ src/swoole/constants.php | 13 +++++++++---- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/swoole/Swoole/Coroutine/Http/Server.php b/src/swoole/Swoole/Coroutine/Http/Server.php index 5f7e9ebf..4c89013e 100644 --- a/src/swoole/Swoole/Coroutine/Http/Server.php +++ b/src/swoole/Swoole/Coroutine/Http/Server.php @@ -4,6 +4,8 @@ namespace Swoole\Coroutine\Http; +use Swoole\Coroutine\Socket; + /** * @not-serializable Objects of this class cannot be serialized. * @alias This class has an alias of "\Co\Http\Server" when directive "swoole.use_shortname" is not explicitly turned off. @@ -46,7 +48,10 @@ public function shutdown(): void { } - private function onAccept(): void + /** + * @param Socket $conn Added since Swoole v5.1.0. + */ + private function onAccept(Socket $conn): void { } } diff --git a/src/swoole/Swoole/Coroutine/Socket.php b/src/swoole/Swoole/Coroutine/Socket.php index 8deee521..ef5a9cdf 100644 --- a/src/swoole/Swoole/Coroutine/Socket.php +++ b/src/swoole/Swoole/Coroutine/Socket.php @@ -31,6 +31,16 @@ class Socket public string $errMsg = ''; + /** + * @since 5.1.0 + */ + public $__ext_sockets_nonblock = false; + + /** + * @since 5.1.0 + */ + public $__ext_sockets_timeout = 0; + public function __construct(int $domain, int $type, int $protocol = 0) { } diff --git a/src/swoole/Swoole/Http2/Request.php b/src/swoole/Swoole/Http2/Request.php index 4977bae0..9f53b5d9 100644 --- a/src/swoole/Swoole/Http2/Request.php +++ b/src/swoole/Swoole/Http2/Request.php @@ -20,4 +20,9 @@ class Request public string $data = ''; public bool $pipeline = false; + + /** + * @since 5.1.0 + */ + public $usePipelineRead = false; } diff --git a/src/swoole/constants.php b/src/swoole/constants.php index a40c352f..ec80973b 100644 --- a/src/swoole/constants.php +++ b/src/swoole/constants.php @@ -5,11 +5,11 @@ /* * Swoole version information. */ -define('SWOOLE_VERSION', '5.0.3'); -define('SWOOLE_VERSION_ID', 50003); +define('SWOOLE_VERSION', '5.1.0'); +define('SWOOLE_VERSION_ID', 50100); define('SWOOLE_MAJOR_VERSION', 5); -define('SWOOLE_MINOR_VERSION', 0); -define('SWOOLE_RELEASE_VERSION', 3); +define('SWOOLE_MINOR_VERSION', 1); +define('SWOOLE_RELEASE_VERSION', 0); define('SWOOLE_EXTRA_VERSION', ''); /* @@ -95,6 +95,7 @@ define('SWOOLE_ERROR_OPERATION_NOT_SUPPORT', 507); define('SWOOLE_ERROR_PROTOCOL_ERROR', 508); define('SWOOLE_ERROR_WRONG_OPERATION', 509); +define('SWOOLE_ERROR_PHP_RUNTIME_NOTICE', 510); // @since 5.1.0 define('SWOOLE_ERROR_FILE_NOT_EXIST', 700); define('SWOOLE_ERROR_FILE_TOO_LARGE', 701); define('SWOOLE_ERROR_FILE_EMPTY', 702); @@ -240,6 +241,9 @@ * @since 4.8.13 and 5.0.2 */ define('SWOOLE_TRACE_ZLIB', 2147483648); // 2^31 +define('SWOOLE_TRACE_CO_PGSQL', 4294967296); // 2^32; @since 5.1.0 +define('SWOOLE_TRACE_CO_ODBC', 8589934592); // 2^33; @since 5.1.0 +define('SWOOLE_TRACE_CO_ORACLE', 17179869184); // 2^34; @since 5.1.0 define('SWOOLE_TRACE_ALL', 9223372036854775807); // 2^63 - 1 // Log levels. @@ -524,6 +528,7 @@ */ define('SWOOLE_HOOK_SOCKETS', 16384); // 2^14 define('SWOOLE_HOOK_STDIO', 32768); // 2^15 +define('SWOOLE_HOOK_PDO_PGSQL', 65536); // 2^16; @since 5.1.0 /* * There are two different hook flags for PHP's cURL functions: * - SWOOLE_HOOK_CURL: Implemented by replacing PHP's cURL functions internally with swoole_curl_*() functions from Swoole Library.