Re: RFC: Server-Side Request and Response Objects (v2)
| From: | Côme Chilliet | Date: | Tue, 18 Feb 2020 14:10:18 +0000 |
| Subject: | Re: RFC: Server-Side Request and Response Objects (v2) | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-108659@lists.php.net to get a copy of this message | ||
Le mardi 18 février 2020, 07:33:37 CET Paul M. Jones a écrit :
> ... the output would be "b\n". As you say, setContent() replaces whatever content is
> already in the ServerResponse. While the comparison for a single echo is accurate, the comparison
> for multiple echoes would be:
>
> $content = "a\n";
> $content .= "b\n";
> $response->setContent($content);
> $responseSender->send($content);
>
> Does that help to clarify?
Yes, but to me that means we also need an addContent method.
Otherwise people will have to carry a global $content along side $response, or use
setContent(getContent().$additionalContent).
--
Côme Chilliet
FusionDirectory - https://www.fusiondirectory.org