Skip to content

Commit d3817f7

Browse files
input和output类的自定义配置可以是数组格式
1 parent bcde590 commit d3817f7

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/HttpServer.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,13 @@ public function setConfig()
111111
$this->httpSocketName = $this->config['http_server']['socket'];
112112
$this->httpPort = $this->config['http_server']['port'];
113113
$this->input = $this->config->get('http.input', Input::class);
114+
if (is_array($this->input)) {
115+
$this->input = $this->input['class'] ?? Input::class;
116+
}
114117
$this->output = $this->config->get('http.output', Output::class);
118+
if (is_array($this->output)) {
119+
$this->output = $this->output['class'] ?? Output::class;
120+
}
115121
return $this;
116122
}
117123

0 commit comments

Comments
 (0)