File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ return [
4+ 'name ' => 'context ' ,
5+ 'description ' => 'コンテキストクラスの生成 ' ,
6+ 'template ' => 'template.php.tpl ' ,
7+ 'output ' => 'app/ContextClass/<%= name %>.php ' ,
8+ ];
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * コンテキストクラスのファイル
4+ *
5+ * UNITパラメータとしての利用と共にグローバル領域としても活用
6+ */
7+
8+ namespace App\ContextClass;
9+
10+ use App\UnitParameter\ParameterForRestApi;
11+
12+
13+ /**
14+ * コンテキストクラス
15+ *
16+ * ParameterForRestApiクラスをオーバーライドして利用する
17+ */
18+ class <%= name %> extends ParameterForRestApi
19+ {
20+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ return [
4+ 'name ' => 'main ' ,
5+ 'description ' => 'メイン処理クラスの生成 ' ,
6+ 'template ' => 'template.php.tpl ' ,
7+ 'output ' => 'app/MainClass/<%= name %>.php ' ,
8+ ];
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ return [
4+ 'identifer ' => 'server-name ' ,
5+ 'description ' => 'サーバーの説明 ' ,
6+ 'setting_cors ' => "'cors' " ,
7+ 'setting_parameter ' => 'null ' ,
8+ 'setting_parser ' => 'null ' ,
9+ 'setting_routing ' => 'null '
10+ ];
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * メイン処理クラスのファイル
4+ *
5+ * SocketManagerの実行
6+ */
7+
8+ namespace App\MainClass;
9+
10+
11+ /**
12+ * メイン処理クラス
13+ *
14+ * メイン処理の初期化と実行
15+ */
16+ class <%= name %> extends MainForRestApi
17+ {
18+ /**
19+ * @var string $identifer サーバー識別子
20+ */
21+ protected string $identifer = ' app:<%= identifer %> {port?} {keep_alive?}' ;
22+
23+ /**
24+ * @var string $description コマンド説明
25+ */
26+ protected string $description = ' <%= description %>' ;
27+
28+ /**
29+ * @var array $setting_files 設定ファイル指定
30+ */
31+ protected array $setting_files = [
32+ ' cors' => <% = setting_cors %> ,
33+ ' parameter' => <% = setting_parameter %> ,
34+ ' parser' => <% = setting_parser %> ,
35+ ' routing' => <% = setting_routing %>
36+ ];
37+
38+ /**
39+ * @var array $classes 設定クラス群
40+ */
41+ protected array $classes = [
42+ ' context' => null,
43+ ' event' => null,
44+ ' parallel' => null
45+ ];
46+
47+ /**
48+ * @var \Closure|string|null $log_writer ログライター
49+ */
50+ public function logWriter(string $p_level , array $p_param )
51+ {
52+ /**
53+ * ここにログ出力処理を実装します
54+ */
55+ }
56+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ return [
4+ 'name ' => 'setting_cors ' ,
5+ 'description ' => 'CORSヘッダ設定ファイルの生成 ' ,
6+ 'template ' => 'template.php.tpl ' ,
7+ 'output ' => 'setting/<%= name %>.php ' ,
8+ ];
Original file line number Diff line number Diff line change 1+ <?php
2+
3+
4+ return [
5+
6+ /**
7+ * "file://"スキームを利用する場合は必ず必要
8+ *
9+ * @var array Access-Control-Allow-Origin ヘッダの許可リスト
10+ */
11+ 'allow_origins ' => "'http://localhost:10000' " ,
12+
13+ /**
14+ * @var array Access-Control-Allow-Headers ヘッダの許可リスト
15+ */
16+ 'allow_headers ' => "'Content-Type' "
17+ ];
Original file line number Diff line number Diff line change 1+ <?php
2+
3+
4+ return [
5+
6+ /**
7+ * "file://"スキームを利用する場合は必ず必要
8+ *
9+ * @var array Access-Control-Allow-Origin ヘッダの許可リスト
10+ */
11+ 'allow_origins' => [
12+ <%= allow_origins %>
13+ ],
14+
15+ /**
16+ * @var array Access-Control-Allow-Headers ヘッダの許可リスト
17+ */
18+ 'allow_headers' => [<%= allow_headers %>]
19+ ];
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ return [
4+ 'name ' => 'setting_parameter ' ,
5+ 'description ' => '基本パラメータ設定ファイルの生成 ' ,
6+ 'template ' => 'template.php.tpl ' ,
7+ 'output ' => 'setting/<%= name %>.php ' ,
8+ ];
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ return [
4+ /**
5+ * @var string ホスト名
6+ */
7+ 'host ' => 'localhost ' ,
8+
9+ /**
10+ * @var int ポート番号
11+ */
12+ 'port ' => '10000 ' ,
13+
14+ /**
15+ * @var int 同時接続制限数
16+ */
17+ 'limit_connection ' => '100 ' ,
18+
19+ /**
20+ * @var int 受信バッファサイズ(バイト数)
21+ */
22+ 'receive_buffer_size ' => '1024 ' ,
23+
24+ /**
25+ * @var int リクエスト(ヘッダ+ボディ)制限サイズ(バイト数)。nullの場合は制限なし。
26+ */
27+ 'limit_request_size ' => '12582912 ' ,
28+
29+ /**
30+ * @var int ボディ部制限サイズ(バイト数)。nullの場合は制限なし。
31+ */
32+ 'limit_body_size ' => '10485760 ' ,
33+
34+ /**
35+ * 周期インターバル時間(μs)
36+ */
37+ 'cycle_interval ' => '10 ' ,
38+
39+ /**
40+ * @var int アライブチェックタイムアウト時間(s)
41+ */
42+ 'alive_interval ' => '5 ' ,
43+
44+ /**
45+ * @var bool KeepAlive フラグ(true:ON or false:OFF)
46+ */
47+ 'keep_alive ' => 'false ' ,
48+
49+ /**
50+ * @var string ETag生成時のモード ⇒ 'strong'(厳密比較) or 'weak'(緩い比較)
51+ */
52+ 'etag ' => 'strong '
53+ ];
You can’t perform that action at this time.
0 commit comments