1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-02 14:57:37 +02:00

[ticket/11150] Add html output formatter

PHPBB3-11150
This commit is contained in:
Tristan Darricau
2015-09-16 13:59:35 +02:00
committed by Tristan Darricau
parent c88c692ad6
commit ab60adb60c
2 changed files with 31 additions and 4 deletions

View File

@@ -436,7 +436,7 @@ class acp_extensions
redirect($this->u_action); redirect($this->u_action);
} }
$formatter = new \Composer\Console\HtmlOutputFormatter([ $formatter = new \phpbb\composer\io\html_output_formatter([
'warning' => new \Symfony\Component\Console\Formatter\OutputFormatterStyle('black', 'yellow') 'warning' => new \Symfony\Component\Console\Formatter\OutputFormatterStyle('black', 'yellow')
]); ]);
@@ -475,7 +475,7 @@ class acp_extensions
redirect($this->u_action); redirect($this->u_action);
} }
$formatter = new \Composer\Console\HtmlOutputFormatter([ $formatter = new \phpbb\composer\io\html_output_formatter([
'warning' => new \Symfony\Component\Console\Formatter\OutputFormatterStyle('black', 'yellow') 'warning' => new \Symfony\Component\Console\Formatter\OutputFormatterStyle('black', 'yellow')
]); ]);
@@ -514,7 +514,7 @@ class acp_extensions
redirect($this->u_action); redirect($this->u_action);
} }
$formatter = new \Composer\Console\HtmlOutputFormatter([ $formatter = new \phpbb\composer\io\html_output_formatter([
'warning' => new \Symfony\Component\Console\Formatter\OutputFormatterStyle('black', 'yellow') 'warning' => new \Symfony\Component\Console\Formatter\OutputFormatterStyle('black', 'yellow')
]); ]);
@@ -553,7 +553,7 @@ class acp_extensions
redirect($this->u_action); redirect($this->u_action);
} }
$formatter = new \Composer\Console\HtmlOutputFormatter([ $formatter = new \phpbb\composer\io\html_output_formatter([
'warning' => new \Symfony\Component\Console\Formatter\OutputFormatterStyle('black', 'yellow') 'warning' => new \Symfony\Component\Console\Formatter\OutputFormatterStyle('black', 'yellow')
]); ]);

View File

@@ -0,0 +1,27 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\composer\io;
class html_output_formatter extends \Composer\Console\HtmlOutputFormatter
{
/**
* {@inheritdoc}
*/
public function format($message)
{
$formatted = parent::format($message);
return preg_replace_callback("{[\033\e]\[([0-9;]+)m(.*?)[\033\e]\[[0-9;]+m}s", array($this, 'formatHtml'), $formatted);
}
}