Skip to content

Commit

Permalink
Merge branch 'ensure-ob-end-flush'
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Jan 17, 2019
2 parents 742891a + 59377da commit a78d8dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Listener/Mvc.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ public function phpError(MvcEvent $e) : void
\ini_set('display_errors', '0');
}

while (\ob_get_level() > 0) {
\ob_end_flush();
}

\ob_start([$this, 'phpFatalErrorHandler']);
\register_shutdown_function([$this, 'execOnShutdown']);
\set_error_handler([$this, 'phpErrorHandler']);
Expand Down
4 changes: 4 additions & 0 deletions src/Middleware/Expressive.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ public function phpError() : void
\ini_set('display_errors', '0');
}

while (\ob_get_level() > 0) {
\ob_end_flush();
}

\ob_start([$this, 'phpFatalErrorHandler']);
\register_shutdown_function([$this, 'execOnShutdown']);
\set_error_handler([$this, 'phpErrorHandler']);
Expand Down

0 comments on commit a78d8dd

Please sign in to comment.