Skip to content

Commit

Permalink
add new changes in Swoole 5.1.0
Browse files Browse the repository at this point in the history
Signed-off-by: Demin Yin <[email protected]>
  • Loading branch information
deminy committed Oct 5, 2023
1 parent ca19f5f commit 738259c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/swoole/Swoole/Coroutine/Http/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
{
}
}
10 changes: 10 additions & 0 deletions src/swoole/Swoole/Coroutine/Socket.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
Expand Down
5 changes: 5 additions & 0 deletions src/swoole/Swoole/Http2/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ class Request
public string $data = '';

public bool $pipeline = false;

/**
* @since 5.1.0
*/
public $usePipelineRead = false;
}
13 changes: 9 additions & 4 deletions src/swoole/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', '');

/*
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 738259c

Please sign in to comment.