Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
BlueScreen: renderToFile() returns bool to indicate if file was writt…
…en by current process (#325)
  • Loading branch information
JanTvrdik authored and dg committed Nov 29, 2018
1 parent f304b9c commit cc23cee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Tracy/BlueScreen.php
Expand Up @@ -89,7 +89,7 @@ public function render(\Throwable $exception): void
/** /**
* Renders blue screen to file (if file exists, it will not be overwritten). * Renders blue screen to file (if file exists, it will not be overwritten).
*/ */
public function renderToFile(\Throwable $exception, string $file): void public function renderToFile(\Throwable $exception, string $file): bool
{ {
if ($handle = @fopen($file, 'x')) { if ($handle = @fopen($file, 'x')) {
ob_start(); // double buffer prevents sending HTTP headers in some PHP ob_start(); // double buffer prevents sending HTTP headers in some PHP
Expand All @@ -98,7 +98,9 @@ public function renderToFile(\Throwable $exception, string $file): void
ob_end_flush(); ob_end_flush();
ob_end_clean(); ob_end_clean();
fclose($handle); fclose($handle);
return true;
} }
return false;
} }




Expand Down

0 comments on commit cc23cee

Please sign in to comment.