Skip to content

Commit 2e662ed

Browse files
fix code (#5576)
1 parent af29dac commit 2e662ed

File tree

4 files changed

+188
-82
lines changed

4 files changed

+188
-82
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PROJECT(libswoole)
22
cmake_minimum_required(VERSION 2.8.12)
33

44
ENABLE_LANGUAGE(ASM)
5-
set(SWOOLE_VERSION 6.0.0-dev)
5+
set(SWOOLE_VERSION 6.0.0RC1)
66

77
set(CMAKE_CXX_STANDARD 11)
88
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -g")

ext-src/php_swoole_library.h

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
+----------------------------------------------------------------------+
1515
*/
1616

17-
/* $Id: 6f6113a57c450c84e00246f2d3c15cf1e7f1f692 */
17+
/* $Id: 1bb86a633f720da45a4d4347f23ff7755c968221 */
1818

1919
#ifndef SWOOLE_LIBRARY_H
2020
#define SWOOLE_LIBRARY_H
@@ -97,9 +97,11 @@ static const char* swoole_library_source_std_exec =
9797
"\n"
9898
"declare(strict_types=1);\n"
9999
"\n"
100+
"use Swoole\\Coroutine\\System;\n"
101+
"\n"
100102
"function swoole_exec(string $command, &$output = null, &$returnVar = null)\n"
101103
"{\n"
102-
" $result = Swoole\\Coroutine::exec($command);\n"
104+
" $result = System::exec($command);\n"
103105
" if ($result) {\n"
104106
" $outputList = explode(PHP_EOL, $result['output']);\n"
105107
" foreach ($outputList as &$value) {\n"
@@ -122,7 +124,7 @@ static const char* swoole_library_source_std_exec =
122124
"\n"
123125
"function swoole_shell_exec(string $cmd)\n"
124126
"{\n"
125-
" $result = Swoole\\Coroutine::exec($cmd);\n"
127+
" $result = System::exec($cmd);\n"
126128
" if ($result && $result['output'] !== '') {\n"
127129
" return $result['output'];\n"
128130
" }\n"
@@ -259,6 +261,10 @@ static const char* swoole_library_source_core_constant =
259261
"\n"
260262
" public const OPTION_IOURING_ENTRIES = 'iouring_entries';\n"
261263
"\n"
264+
" public const OPTION_IOURING_WORKERS = 'iouring_workers';\n"
265+
"\n"
266+
" public const OPTION_IOURING_FLAG = 'iouring_flag';\n"
267+
"\n"
262268
" public const OPTION_ENABLE_SIGNALFD = 'enable_signalfd';\n"
263269
"\n"
264270
" public const OPTION_WAIT_SIGNAL = 'wait_signal';\n"
@@ -3716,9 +3722,9 @@ static const char* swoole_library_source_core_curl_handler =
37163722
"\n"
37173723
"namespace Swoole\\Curl;\n"
37183724
"\n"
3719-
"use Swoole;\n"
37203725
"use Swoole\\Constant;\n"
37213726
"use Swoole\\Coroutine\\Http\\Client;\n"
3727+
"use Swoole\\Coroutine\\System;\n"
37223728
"use Swoole\\Curl\\Exception as CurlException;\n"
37233729
"use Swoole\\Http\\Status;\n"
37243730
"\n"
@@ -4420,7 +4426,7 @@ static const char* swoole_library_source_core_curl_handler =
44204426
" }\n"
44214427
"\n"
44224428
" if (!filter_var($proxy, FILTER_VALIDATE_IP)) {\n"
4423-
" $ip = Swoole\\Coroutine::gethostbyname($proxy, AF_INET, $this->clientOptions['connect_timeout'] ?? -1);\n"
4429+
" $ip = System::gethostbyname($proxy, AF_INET, $this->clientOptions['connect_timeout'] ?? -1);\n"
44244430
" if (!$ip) {\n"
44254431
" $this->setError(CURLE_COULDNT_RESOLVE_PROXY, 'Could not resolve proxy: ' . $proxy);\n"
44264432
" return false;\n"
@@ -9186,6 +9192,7 @@ static const char* swoole_library_source_core_thread_pool =
91869192
" private object $running;\n"
91879193
"\n"
91889194
" private object $queue;\n"
9195+
"\n"
91899196
" private array $indexes = [];\n"
91909197
"\n"
91919198
" public function __construct(string $runnableClass, int $threadNum)\n"
@@ -9197,7 +9204,7 @@ static const char* swoole_library_source_core_thread_pool =
91979204
" $this->threadNum = $threadNum;\n"
91989205
" }\n"
91999206
"\n"
9200-
" public function withArguments(array $arguments): static\n"
9207+
" public function withArguments(...$arguments): static\n"
92019208
" {\n"
92029209
" $this->arguments = $arguments;\n"
92039210
" return $this;\n"
@@ -9218,7 +9225,7 @@ static const char* swoole_library_source_core_thread_pool =
92189225
" /**\n"
92199226
" * @throws \\ReflectionException\n"
92209227
" */\n"
9221-
" public function start(array $arguments = []): void\n"
9228+
" public function start(): void\n"
92229229
" {\n"
92239230
" if (empty($this->classDefinitionFile) and class_exists($this->runnableClass, false)) {\n"
92249231
" $file = (new \\ReflectionClass($this->runnableClass))->getFileName();\n"
@@ -9283,11 +9290,11 @@ static const char* swoole_library_source_core_thread_pool =
92839290
"\n"
92849291
" while ($this->running->get()) {\n"
92859292
" $threadId = $this->queue->pop(-1);\n"
9286-
" $thread = $this->threads[$threadId];\n"
9287-
" $index = $this->indexes[$threadId];\n"
9293+
" $thread = $this->threads[$threadId];\n"
9294+
" $index = $this->indexes[$threadId];\n"
92889295
" $thread->join();\n"
9289-
" unset($this->threads[$threadId]);\n"
9290-
" unset($this->indexes[$threadId]);\n"
9296+
" unset($this->threads[$threadId], $this->indexes[$threadId]);\n"
9297+
"\n"
92919298
" $this->createThread($index);\n"
92929299
" }\n"
92939300
"\n"
@@ -9370,12 +9377,13 @@ static const char* swoole_library_source_core_thread_runnable =
93709377
"abstract class Runnable\n"
93719378
"{\n"
93729379
" protected Atomic $running;\n"
9380+
"\n"
93739381
" protected int $id;\n"
93749382
"\n"
93759383
" public function __construct($running, $index)\n"
93769384
" {\n"
93779385
" $this->running = $running;\n"
9378-
" $this->id = $index;\n"
9386+
" $this->id = $index;\n"
93799387
" }\n"
93809388
"\n"
93819389
" abstract public function run(array $args): void;\n"

include/swoole_version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
#define SWOOLE_MAJOR_VERSION 6
2222
#define SWOOLE_MINOR_VERSION 0
2323
#define SWOOLE_RELEASE_VERSION 0
24-
#define SWOOLE_EXTRA_VERSION "dev"
25-
#define SWOOLE_VERSION "6.0.0-dev"
24+
#define SWOOLE_EXTRA_VERSION ""
25+
#define SWOOLE_VERSION "6.0.0RC1"
2626
#define SWOOLE_VERSION_ID 60000
2727
#define SWOOLE_API_VERSION_ID 0x202208a
2828

0 commit comments

Comments
 (0)