Permalink
Browse files

BlueScreen: renderToFile() returns bool to indicate if file was writt…

…en by current process (#325)
  • Loading branch information...
JanTvrdik authored and dg committed Oct 9, 2018
1 parent f304b9c commit cc23cee96dfb6ffe949b17a1a0f4eb8b983bd224
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/Tracy/BlueScreen.php
@@ -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
@@ -98,7 +98,9 @@ public function renderToFile(\Throwable $exception, string $file): void
ob_end_flush();
ob_end_clean();
fclose($handle);
return true;
}
return false;
}

0 comments on commit cc23cee

Please sign in to comment.