From bce6a9d344e895d12aff9f3e98f72ec705dc6ece Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 25 Apr 2012 14:48:42 -0700 Subject: [PATCH] Don't write warnings to reports and don't print report if written to file --- PHP/CompatInfo/Report.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/PHP/CompatInfo/Report.php b/PHP/CompatInfo/Report.php index 89f25523..22537ca4 100644 --- a/PHP/CompatInfo/Report.php +++ b/PHP/CompatInfo/Report.php @@ -77,6 +77,15 @@ public function __construct($source, $options, $warnings) $this->generate($report, $base, $options['verbose']); + if (isset($options['reportFile'])) { + $generatedReport = ob_get_clean(); + + file_put_contents( + $options['reportFile'], $generatedReport, + $options['reportFileFlags'] + ); + } + if (count($allWarnings) > 0 && $options['verbose'] > 0) { echo 'Warning messages : (' . count($allWarnings) . ')' . PHP_EOL; echo PHP_EOL; @@ -88,16 +97,6 @@ public function __construct($source, $options, $warnings) echo ' ' . $warn . PHP_EOL; } } - - if (isset($options['reportFile'])) { - $generatedReport = ob_get_contents(); - ob_end_flush(); - - file_put_contents( - $options['reportFile'], $generatedReport, - $options['reportFileFlags'] - ); - } } /**