Skip to content

Commit 1bbac67

Browse files
v1.5.0 Release
パーサークラスのselectorメソッドがnullを返した時の挙動を追加 SimpleSocketのParallelでREST-API側の基本パラメータと連携できる機能を追加 SimpleSocketのParallelでランチャーと連携するサービス名を変更 コメントの整理
1 parent eccdbef commit 1bbac67

6 files changed

Lines changed: 15 additions & 6 deletions

File tree

app/BodyParser/JsonParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* ボディ部パーサークラスのファイル
44
*
5-
* 設定ファイルで指定されたパーサークラス
5+
* 設定ファイルで指定されるパーサークラス
66
*/
77

88
namespace App\BodyParser;

app/BodyParser/UrlencodedParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* ボディ部パーサークラスのファイル
44
*
5-
* 設定ファイルで指定されたパーサークラス
5+
* 設定ファイルで指定されるパーサークラス
66
*/
77

88
namespace App\BodyParser;

app/BodyParser/XmlParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* ボディ部パーサークラスのファイル
44
*
5-
* 設定ファイルで指定されたパーサークラス
5+
* 設定ファイルで指定されるパーサークラス
66
*/
77

88
namespace App\BodyParser;

app/InitClass/InitForRestApi.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ public function getCommandDispatcher()
193193
if(stripos($content_type, $type) !== false)
194194
{
195195
$method_name = $parser->selector($p_param->request(), $this->request->getUri()->getPath());
196+
if(!isset($method_name))
197+
{
198+
$method_name = 'normal';
199+
}
196200
$parsed_body = $parser->$method_name($this->request->getBody()->__toString());
197201
$this->request = $this->request->withParsedBody($parsed_body);
198202
$p_param->setTempBuff(['__req-ins' => $this->request]);
@@ -298,6 +302,10 @@ public function getCommandDispatcher()
298302
if(stripos($content_type, $type) !== false)
299303
{
300304
$method_name = $parser->selector($p_param->request(), $this->request->getUri()->getPath());
305+
if(!isset($method_name))
306+
{
307+
$method_name = 'normal';
308+
}
301309
$parsed_body = $parser->$method_name($this->request->getBody()->__toString());
302310
$this->request = $this->request->withParsedBody($parsed_body);
303311
$p_param->setTempBuff(['__req-ins' => $this->request]);

app/MainClass/MainForRestApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ public function exec()
346346
// パラレルクラスの初期化処理
347347
if($this->classes['parallel'] !== null)
348348
{
349-
$this->parallel = new $this->classes['parallel']($unit_parameter);
349+
$this->parallel = new $this->classes['parallel']($cli_parameter, $unit_parameter);
350350
$this->parallel->initMain();
351351
}
352352

app/ParallelClass/ParallelForSimpleSocket.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ class ParallelForSimpleSocket implements IParallelClass
2727
/**
2828
* コンストラクタ
2929
*
30+
* @param ?array $p_conf_param 基本パラメータ
3031
* @param ContextForSample $p_context コンテキストクラスのインスタンス
3132
*/
32-
public function __construct($p_context)
33+
public function __construct(?array $p_conf_param, $p_context)
3334
{
3435
$this->context = $p_context;
3536
}
@@ -51,7 +52,7 @@ public function initMain(): bool
5152
$send_data =
5253
[
5354
[
54-
'service' => 'minecraft-parent',
55+
'service' => 'rest-api-sample',
5556
'type' => 'user-cnt',
5657
'data' => $all_cnt
5758
]

0 commit comments

Comments
 (0)