Add support for a simplified pure ASCII version of the tree view, refs #2600
parent
92ad33d11e
commit
e6e636802f
|
@ -489,7 +489,7 @@ EOT
|
||||||
foreach ($requires as $requireName => $require) {
|
foreach ($requires as $requireName => $require) {
|
||||||
$j++;
|
$j++;
|
||||||
if ($j == 0) {
|
if ($j == 0) {
|
||||||
$output->writeln($treeBar);
|
$this->writeTreeLine($treeBar);
|
||||||
}
|
}
|
||||||
if ($j == $total) {
|
if ($j == $total) {
|
||||||
$treeBar = '└';
|
$treeBar = '└';
|
||||||
|
@ -497,7 +497,7 @@ EOT
|
||||||
$level = 1;
|
$level = 1;
|
||||||
$color = $this->colors[$level];
|
$color = $this->colors[$level];
|
||||||
$info = sprintf('%s──<%s>%s</%s> %s', $treeBar, $color, $requireName, $color, $require->getPrettyConstraint());
|
$info = sprintf('%s──<%s>%s</%s> %s', $treeBar, $color, $requireName, $color, $require->getPrettyConstraint());
|
||||||
$output->writeln($info);
|
$this->writeTreeLine($info);
|
||||||
|
|
||||||
$treeBar = str_replace('└', ' ', $treeBar);
|
$treeBar = str_replace('└', ' ', $treeBar);
|
||||||
|
|
||||||
|
@ -537,7 +537,7 @@ EOT
|
||||||
$colorIdent = $level % count($this->colors);
|
$colorIdent = $level % count($this->colors);
|
||||||
$color = $this->colors[$colorIdent];
|
$color = $this->colors[$colorIdent];
|
||||||
$info = sprintf('%s──<%s>%s</%s> %s', $treeBar, $color, $requireName, $color, $require->getPrettyConstraint());
|
$info = sprintf('%s──<%s>%s</%s> %s', $treeBar, $color, $requireName, $color, $require->getPrettyConstraint());
|
||||||
$output->writeln($info);
|
$this->writeTreeLine($info);
|
||||||
|
|
||||||
$treeBar = str_replace('└', ' ', $treeBar);
|
$treeBar = str_replace('└', ' ', $treeBar);
|
||||||
if (!in_array($requireName, $packagesInTree)) {
|
if (!in_array($requireName, $packagesInTree)) {
|
||||||
|
@ -547,4 +547,14 @@ EOT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function writeTreeLine($line)
|
||||||
|
{
|
||||||
|
$io = $this->getIO();
|
||||||
|
if (!$io->isDecorated()) {
|
||||||
|
$line = str_replace(array('└', '├', '──', '│'), array('`-', '|-', '-', '|'), $line);
|
||||||
|
}
|
||||||
|
|
||||||
|
$io->write($line);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue