Skip to content

Commit

Permalink
BlueScreen: renderToFile() returns bool to indicate if file was writt…
Browse files Browse the repository at this point in the history
…en by current process (#325)
  • Loading branch information
JanTvrdik authored and dg committed Feb 17, 2019
1 parent 69b3147 commit 3030c0a
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).
*/
public function renderToFile(\Throwable $exception, string $file): void
public function renderToFile(\Throwable $exception, string $file): bool
{
if ($handle = @fopen($file, 'x')) {
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_clean();
fclose($handle);
return true;
}
return false;
}


Expand Down

0 comments on commit 3030c0a

Please sign in to comment.