Skip to content

Commit 4669ff1

Browse files
committed
Merge branch '6.4' into 7.0
* 6.4: do not allow version 7 of the HttpKernel component favor Twig's include() function over the include tag add missing class alias to satisfy autoloading remove the .data_collector.command service if its class does not exist [HttpFoundation] Add $flush parameter to Response::send() fix typo DX: PHP CS Fixer - allow for no_superfluous_phpdoc_tags.allow_unused_params
2 parents cac17e0 + 2970be3 commit 4669ff1

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ CHANGELOG
1919
* Support root-level `Generator` in `StreamedJsonResponse`
2020
* Add `UriSigner` from the HttpKernel component
2121
* Add `partitioned` flag to `Cookie` (CHIPS Cookie)
22+
* Add argument `bool $flush = true` to `Response::send()`
2223

2324
6.3
2425
---

Response.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,13 +388,20 @@ public function sendContent(): static
388388
/**
389389
* Sends HTTP headers and content.
390390
*
391+
* @param bool $flush Whether output buffers should be flushed
392+
*
391393
* @return $this
392394
*/
393-
public function send(): static
395+
public function send(/* bool $flush = true */): static
394396
{
395397
$this->sendHeaders();
396398
$this->sendContent();
397399

400+
$flush = 1 <= \func_num_args() ? func_get_arg(0) : true;
401+
if (!$flush) {
402+
return $this;
403+
}
404+
398405
if (\function_exists('fastcgi_finish_request')) {
399406
fastcgi_finish_request();
400407
} elseif (\function_exists('litespeed_finish_request')) {

0 commit comments

Comments
 (0)