Skip to content

Commit 3caa0bb

Browse files
authored
WIP
* WIP * Tidy up * Fix code format * Fix code format * Updated ignore file * Fix code format * Updated version template
1 parent c5cc82f commit 3caa0bb

File tree

11 files changed

+19
-25
lines changed

11 files changed

+19
-25
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,6 @@ tools/PHP-Parser-*/
109109
/html
110110
/tests/include/lib/vendor/
111111
travis/octane/
112+
113+
# package
114+
openswoole-*.tgz

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ After compiling and installing the openswoole extension, you have to add a new l
7373
- [**PHP Runtime**](https://github.com/php-runtime) make it easy to run any kind of PHP Application (Symfony, Laravel, PSR7, Native) with all kinds of Runtimes like OpenSwoole, Bref, Google Cloud Functions, Roadrunner and React PHP with minimal configuration.
7474
- [**Mezzio Swoole**](https://docs.mezzio.dev/mezzio-swoole/) allows you to run Mezzio and [PSR-15](https://www.php-fig.org/psr/psr-15/) applications on Open Swoole.
7575

76-
## Call for Contributors
76+
## For Contributors
7777

7878
If you like to involve the maintenance of this repo, it is better to get started by submitting PR, you will be invited to the dev group once there are significant contributions. Or join Slack group firstly, the team will provide mentoring and internal support to help you get started.
7979

code_format.sh

-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ clang-format -i src/lock/*.cc
55
clang-format -i src/memory/*.cc
66
clang-format -i src/network/*.cc
77
clang-format -i src/os/*.cc
8-
clang-format -i src/pipe/*.cc
98
clang-format -i src/protocol/*.cc
109
clang-format -i src/reactor/*.cc
1110
clang-format -i src/server/*.cc
@@ -14,21 +13,18 @@ clang-format -i src/wrapper/*.cc
1413
clang-format -i include/*.h
1514

1615
# ext source file
17-
clang-format -i *.cc
1816
clang-format -i *.h
1917

2018
clang-format -i examples/cpp/*.cc
2119

2220
# core-tests source file
2321
clang-format -i core-tests/src/_lib/*.cpp
24-
clang-format -i core-tests/src/client/*.cpp
2522
clang-format -i core-tests/src/core/*.cpp
2623
clang-format -i core-tests/src/coroutine/*.cpp
2724
clang-format -i core-tests/src/lock/*.cpp
2825
clang-format -i core-tests/src/memory/*.cpp
2926
clang-format -i core-tests/src/network/*.cpp
3027
clang-format -i core-tests/src/os/*.cpp
31-
clang-format -i core-tests/src/process/*.cpp
3228
clang-format -i core-tests/src/protocol/*.cpp
3329
clang-format -i core-tests/src/reactor/*.cpp
3430
clang-format -i core-tests/src/server/*.cpp

include/swoole_version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
#define SWOOLE_API_VERSION_ID 0x202012a
2222

2323
#define SWOOLE_BUG_REPORT \
24-
"A bug occurred in OpenSwoole-v" SWOOLE_VERSION ", please report it.\n" \
24+
"A bug occurred in OpenSwoole-v" SWOOLE_VERSION ", please report it.\n" \
2525
"The Swoole developers probably don't know about it,\n" \
2626
"and unless you report it, chances are it won't be fixed.\n" \
2727
"You can read How to report a bug doc before submitting any bug reports:\n" \
28-
">> https://github.com/openswoole/swoole-src/blob/master/.github/ISSUE.md \n" \
28+
">> https://github.com/openswoole/swoole-src/blob/master/.github/ISSUE.md \n" \
2929
"Please do not send bug reports in the mailing list or personal letters.\n" \
3030
"The issue page is also suitable to submit feature requests.\n"
3131

package.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<email>[email protected]</email>
1313
<active>yes</active>
1414
</lead>
15-
<date>2022-03-24</date>
16-
<time>15:00:00</time>
15+
<date>2022-04-14</date>
16+
<time>22:00:00</time>
1717
<version>
1818
<release>4.11.0</release>
1919
<api>4.0</api>
@@ -1337,6 +1337,7 @@
13371337
<file role="test" name="tests/swoole_http_server/bug_2947.phpt" />
13381338
<file role="test" name="tests/swoole_http_server/bug_2988.phpt" />
13391339
<file role="test" name="tests/swoole_http_server/bug_compression_level.phpt" />
1340+
<file role="test" name="tests/swoole_http_server/bug_cookie_parse.phpt" />
13401341
<file role="test" name="tests/swoole_http_server/bug_get_request_data_after_end.phpt" />
13411342
<file role="test" name="tests/swoole_http_server/callback_new_obj_method.phpt" />
13421343
<file role="test" name="tests/swoole_http_server/callback_new_static_method.phpt" />

src/core/error.cc

+2-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ const char *swoole_strerror(int code) {
2727
return strerror(code);
2828
}
2929
/* swstrerror {{{*/
30-
switch(code)
31-
{
30+
switch (code) {
3231
case SW_ERROR_MALLOC_FAIL:
3332
return "Malloc fail";
3433
case SW_ERROR_SYSTEM_CALL_FAIL:
@@ -238,7 +237,7 @@ const char *swoole_strerror(int code) {
238237
#endif
239238
return buffer;
240239
}
241-
/*}}}*/
240+
/*}}}*/
242241
}
243242

244243
void swoole_throw_error(int code) {

tests/swoole_http2_client_coro/goaway.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ go(function () {
1515
'ssl_host_name' => $domain
1616
]);
1717
if (!$cli->connect()) {
18-
return; // we can't connect to this website without proxy in China so we skip it.
18+
return;
1919
}
2020
$cli->goaway(SWOOLE_HTTP2_ERROR_NO_ERROR, '[GOAWAY] nothing~bye~bye~');
2121
Assert::assert(!$cli->recv(-1));

tests/swoole_http2_client_coro/ping.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ go(function () {
1212
$cli = new Swoole\Coroutine\Http2\Client('nghttp2.org', 443, true);
1313
$cli->set(['timeout' => 5,]);
1414
if (!$cli->connect()) {
15-
return; // we can't connect to this website without proxy in China so we skip it.
15+
return;
1616
}
1717
$ret = $cli->ping();
1818
Assert::assert($ret);

tests/swoole_http_server/bug_cookie_parse.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ array(3) {
3838
string(0) ""
3939
["q"]=>
4040
string(40) "URVVma5UgEDm9RmQvBfXs7rCEG9hs9td9CXXmBRQ"
41-
}
41+
}

tools/code-generator.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
// generate ERROR strings
6464
$swoole_error_cc = ROOT_DIR . '/src/core/error.cc';
6565
$swoole_error_cc_content = file_get_contents($swoole_error_cc);
66-
$swstrerror_output = space(4) . "switch(code)\n" . space(4) . "{\n";
66+
$swstrerror_output = space(4) . "switch (code) {\n";
6767
foreach ($matches_error[0] as $match) {
6868
// convert error code to swstrerror
6969
$sw_error_str = implode(' ', explode('_', strtolower(str_replace('SW_ERROR_', '', $match))));
@@ -91,7 +91,7 @@
9191
$swstrerror_output .= "\n";
9292
$swoole_error_cc_content = preg_replace(
9393
'/(\* swstrerror \{\{\{\*\/\n)([\s\S]+?)(\/\*\}\}\}\*\/)/',
94-
'${1}' . $swstrerror_output . '${3}',
94+
'${1}' . $swstrerror_output . ' ${3}',
9595
$swoole_error_cc_content, 1, $is_ok
9696
);
9797
swoole_check($is_ok, 'Generate ERROR stringify');

tools/templates/version.tpl.h

+3-8
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,7 @@
2121
#define SWOOLE_API_VERSION_ID 0x202012a
2222

2323
#define SWOOLE_BUG_REPORT \
24-
"A bug occurred in OpenSwoole-v" SWOOLE_VERSION ", please report it.\n" \
25-
"The Swoole developers probably don't know about it,\n" \
26-
"and unless you report it, chances are it won't be fixed.\n" \
27-
"You can read How to report a bug doc before submitting any bug reports:\n" \
28-
">> https://github.com/openswoole/swoole-src/blob/master/.github/ISSUE.md \n" \
29-
"Please do not send bug reports in the mailing list or personal letters.\n" \
30-
"The issue page is also suitable to submit feature requests.\n"
31-
24+
"A bug occurred in OpenSwoole-v" SWOOLE_VERSION ", please report it.\n" \
25+
"Please submit bug report at:\n" \
26+
">> https://github.com/openswoole/swoole-src/issues \n" \
3227
#endif

0 commit comments

Comments
 (0)