File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ CHANGELOG
8
8
* Support root-level ` Generator ` in ` StreamedJsonResponse `
9
9
* Add ` UriSigner ` from the HttpKernel component
10
10
* Add ` partitioned ` flag to ` Cookie ` (CHIPS Cookie)
11
+ * Add argument ` bool $flush = true ` to ` Response::send() `
11
12
12
13
6.3
13
14
---
Original file line number Diff line number Diff line change @@ -415,13 +415,20 @@ public function sendContent(): static
415
415
/**
416
416
* Sends HTTP headers and content.
417
417
*
418
+ * @param bool $flush Whether output buffers should be flushed
419
+ *
418
420
* @return $this
419
421
*/
420
- public function send (): static
422
+ public function send (/* bool $flush = true */ ): static
421
423
{
422
424
$ this ->sendHeaders ();
423
425
$ this ->sendContent ();
424
426
427
+ $ flush = 1 <= \func_num_args () ? func_get_arg (0 ) : true ;
428
+ if (!$ flush ) {
429
+ return $ this ;
430
+ }
431
+
425
432
if (\function_exists ('fastcgi_finish_request ' )) {
426
433
fastcgi_finish_request ();
427
434
} elseif (\function_exists ('litespeed_finish_request ' )) {
You can’t perform that action at this time.
0 commit comments