Check output buffering level

This commit is contained in:
Daniil Gentili 2020-09-11 09:30:08 +02:00
parent 9e5027a4a7
commit 16719ec28f
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
2 changed files with 8 additions and 4 deletions

View File

@ -4,7 +4,7 @@
"dockerfile": "Dockerfile", "dockerfile": "Dockerfile",
"args": { "args": {
// Update VARIANT to pick a PHP version: 7, 7.4, 7.3 // Update VARIANT to pick a PHP version: 7, 7.4, 7.3
"VARIANT": "7", "VARIANT": "7.4",
"INSTALL_NODE": "true", "INSTALL_NODE": "true",
"NODE_VERSION": "lts/*" "NODE_VERSION": "lts/*"
} }
@ -18,7 +18,9 @@
// Add the IDs of extensions you want installed when the container is created. // Add the IDs of extensions you want installed when the container is created.
"extensions": [ "extensions": [
"felixfbecker.php-debug", "felixfbecker.php-debug",
"felixfbecker.php-intellisense" "felixfbecker.php-intellisense",
"getpsalm.psalm-vscode-plugin",
"junstyle.php-cs-fixer"
] ]
// Use 'forwardPorts' to make a list of ports inside the container available locally. // Use 'forwardPorts' to make a list of ports inside the container available locally.

View File

@ -946,8 +946,10 @@ trait Files
if (!\in_array($result->getCode(), [Status::OK, Status::PARTIAL_CONTENT])) { if (!\in_array($result->getCode(), [Status::OK, Status::PARTIAL_CONTENT])) {
yield Tools::echo($result->getCodeExplanation()); yield Tools::echo($result->getCodeExplanation());
} elseif ($result->shouldServe()) { } elseif ($result->shouldServe()) {
\ob_end_flush(); if (\ob_get_level()) {
\ob_implicit_flush(); \ob_end_flush();
\ob_implicit_flush();
}
yield from $this->downloadToStream($messageMedia, \fopen('php://output', 'w'), $cb, ...$result->getServeRange()); yield from $this->downloadToStream($messageMedia, \fopen('php://output', 'w'), $cb, ...$result->getServeRange());
} }
} }