改名
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "framework/snowflake",
|
||||
"name": "game-worker/snowflake",
|
||||
"description": "test framework",
|
||||
"authors": [
|
||||
{
|
||||
|
||||
+7
-2
@@ -4,6 +4,7 @@ defined('APP_PATH') or define('APP_PATH', __DIR__ . '/../../');
|
||||
|
||||
use HttpServer\Http\Response;
|
||||
use Snowflake\Snowflake;
|
||||
use HttpServer\Http\Context;
|
||||
|
||||
if (!function_exists('make')) {
|
||||
|
||||
@@ -90,8 +91,12 @@ if (!function_exists('alias')) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!function_exists('name')) {
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
function name($name)
|
||||
{
|
||||
swoole_set_process_name($name);
|
||||
@@ -107,10 +112,10 @@ if (!function_exists('response')) {
|
||||
*/
|
||||
function response()
|
||||
{
|
||||
if (!Snowflake::has('response')) {
|
||||
if (!Context::hasContext('response')) {
|
||||
return make('response', Response::class);
|
||||
}
|
||||
return Snowflake::get()->response;
|
||||
return Context::getContext('response');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ use Swoole\WebSocket\Frame;
|
||||
return [
|
||||
'servers' => [
|
||||
[
|
||||
'id' => '',
|
||||
'type' => Server::HTTP,
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 9527,
|
||||
@@ -26,6 +27,7 @@ return [
|
||||
]
|
||||
],
|
||||
[
|
||||
'id' => '',
|
||||
'type' => Server::PACKAGE,
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 9628,
|
||||
@@ -45,6 +47,7 @@ return [
|
||||
]
|
||||
],
|
||||
[
|
||||
'id' => '',
|
||||
'type' => Server::TCP,
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 9629,
|
||||
@@ -68,6 +71,7 @@ return [
|
||||
]
|
||||
],
|
||||
[
|
||||
'id' => '',
|
||||
'type' => Server::WEBSOCKET,
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 9530,
|
||||
|
||||
Reference in New Issue
Block a user