1
|
|
|
<?php |
2
|
|
|
namespace tonisormisson\browsercomposer; |
3
|
|
|
|
4
|
|
|
use Symfony\Component\Console\Formatter\OutputFormatterInterface; |
|
|
|
|
5
|
|
|
|
6
|
|
|
class HtmlOutput extends \Symfony\Component\Console\Output\Output |
|
|
|
|
7
|
|
|
{ |
8
|
|
|
|
9
|
|
|
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = false, OutputFormatterInterface $formatter = null) |
10
|
|
|
{ |
11
|
|
|
parent::__construct($verbosity, $decorated, $formatter); |
12
|
|
|
|
13
|
|
|
// tell php to automatically flush after every output |
14
|
|
|
//$this->disableOb(); |
15
|
|
|
} |
16
|
|
|
|
17
|
|
|
protected function disableOb() |
18
|
|
|
{ |
19
|
|
|
// Turn off output buffering |
20
|
|
|
ini_set('output_buffering', 'off'); |
21
|
|
|
// Turn off PHP output compression |
22
|
|
|
//ini_set('zlib.output_compression', false); |
23
|
|
|
// Implicitly flush the buffer(s) |
24
|
|
|
ini_set('implicit_flush', true); |
|
|
|
|
25
|
|
|
ob_implicit_flush(true); |
|
|
|
|
26
|
|
|
// Clear, and turn off output buffering |
27
|
|
|
while (ob_get_level() > 0) { |
28
|
|
|
// Get the curent level |
29
|
|
|
$level = ob_get_level(); |
30
|
|
|
// End the buffering |
31
|
|
|
ob_end_clean(); |
32
|
|
|
// If the current level has not changed, abort |
33
|
|
|
if (ob_get_level() == $level) { |
34
|
|
|
break; |
35
|
|
|
} |
36
|
|
|
} |
37
|
|
|
// Disable apache output buffering/compression |
38
|
|
|
if (function_exists('apache_setenv')) { |
39
|
|
|
apache_setenv('no-gzip', '1'); |
40
|
|
|
apache_setenv('dont-vary', '1'); |
41
|
|
|
} |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
protected function h($text) |
45
|
|
|
{ |
46
|
|
|
return htmlspecialchars($text); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
public function writeln($messages, $options = 0) |
50
|
|
|
{ |
51
|
|
|
$this->write($messages, true, $options); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function write($messages, $newline = false, $options = self::OUTPUT_NORMAL) |
55
|
|
|
{ |
56
|
|
|
$this->doWrite($messages, $newline); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
protected function doWrite($message, $newline) |
60
|
|
|
{ |
61
|
|
|
|
62
|
|
|
//echo $this->h($message); |
63
|
|
|
echo $message; |
64
|
|
|
|
65
|
|
|
if ($newline) { |
66
|
|
|
echo "\n"; |
67
|
|
|
} |
68
|
|
|
if (ob_get_length()) { |
69
|
|
|
ob_flush(); |
70
|
|
|
flush(); |
71
|
|
|
} |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths