Skip to content

Commit

Permalink
Update library, remove CREDITS
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Oct 12, 2021
1 parent 09e0427 commit 372fdb8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
3 changes: 0 additions & 3 deletions CREDITS

This file was deleted.

19 changes: 12 additions & 7 deletions ext-src/php_swoole_library.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Generated by build-library.php, Please DO NOT modify!
*/

/* $Id: a6b2a575a3a0ae9d66b8140650d1a98b00bd4097 */
/* $Id: 34a3bb25db6d0dfd46128628ed753f8ad84a5ab8 */

static const char* swoole_library_source_constants =
"\n"
Expand Down Expand Up @@ -7181,11 +7181,11 @@ static const char* swoole_library_source_core_server_admin =
" {\n"
" $admin_server_uri = swoole_string($server->setting['admin_server']);\n"
" if ($admin_server_uri->startsWith('unix:/')) {\n"
" $admin_server = new Coroutine\\Http\\Server($admin_server_uri->toString());\n"
" } else {\n"
" [$host, $port] = $admin_server_uri->split(':', 2)->toArray();\n"
" $admin_server = new Coroutine\\Http\\Server($host, intval($port));\n"
" return swoole_error_log(SWOOLE_LOG_ERROR, \"admin_server[{$server->setting['admin_server']}] is not supported\");\n"
" }\n"
" [$host, $port] = $admin_server_uri->split(':', 2)->toArray();\n"
" $admin_server = new Coroutine\\Http\\Server($host, intval($port));\n"
"\n"
" $admin_server->handle('/api', function (Request $req, Response $resp) use ($server) {\n"
" $path_array = swoole_string($req->server['request_uri'])->trim('/')->split('/');\n"
" if ($path_array->count() < 2 or $path_array->count() > 3) {\n"
Expand Down Expand Up @@ -7240,7 +7240,7 @@ static const char* swoole_library_source_core_server_admin =
" }\n"
"\n"
" $resp->header('Access-Control-Allow-Origin', '*');\n"
" $resp->header('Access-Control-Allow-Methods', 'GET, OPTIONS');\n"
" $resp->header('Access-Control-Allow-Methods', 'GET, OPTIONS');\n"
" $resp->header('Access-Control-Allow-Headers', 'X-ACCESS-TOKEN');\n"
"\n"
" $result = $server->command($cmd, intval($process_id), intval($process_type), $data, false);\n"
Expand All @@ -7266,7 +7266,7 @@ static const char* swoole_library_source_core_server_admin =
" }\n"
" $tmp_file = '/tmp/swoole_dashborad.' . SWOOLE_VERSION . '.tar.gz';\n"
" file_put_contents($tmp_file, $download_request->getBody());\n"
" if (is_file($tmp_file) or filesize($tmp_file) == 0) {\n"
" if (!is_file($tmp_file) or filesize($tmp_file) === 0) {\n"
" $resp->end(\"write [{$tmp_file}] failed\");\n"
" return;\n"
" }\n"
Expand All @@ -7275,6 +7275,11 @@ static const char* swoole_library_source_core_server_admin =
" }\n"
" $sh = 'tar zxvf ' . $tmp_file . ' -C ' . $dir;\n"
" System::exec($sh);\n"
" $remote_addr = $req->server['remote_addr'];\n"
" $server_port = $req->server['server_port'];\n"
" $f = $dir . '/dist/js/app.js';\n"
" $baseURL = 'baseURL:\"http://' . $remote_addr . ':' . $server_port . '/\"';\n"
" file_put_contents($f, str_replace('baseURL:\"http://127.0.0.1:9502/\"', $baseURL, file_get_contents($f)));\n"
" }\n"
" }\n"
"\n"
Expand Down

0 comments on commit 372fdb8

Please sign in to comment.