Adding ansi-to-html
This commit is contained in:
parent
1909871e55
commit
d3917a1c24
16
classes.php
16
classes.php
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use \Ospinto\Dbug;
|
||||
use \SensioLabs\AnsiConverter\AnsiToHtmlConverter;
|
||||
|
||||
abstract class AbstractAction
|
||||
{
|
||||
@ -202,6 +203,21 @@ class ActionDateC extends AbstractAction
|
||||
}
|
||||
}
|
||||
|
||||
class ActionAnsi2Html extends AbstractAction
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setContainer( new DivContainer );
|
||||
$this->setFormatter( new EchoFormatter );
|
||||
}
|
||||
|
||||
public function decode()
|
||||
{
|
||||
$converter = new AnsiToHtmlConverter();
|
||||
return htmlentities(nl2br($converter->convert($this->value)));
|
||||
}
|
||||
}
|
||||
|
||||
class ActionParseStr extends AbstractAction
|
||||
{
|
||||
public function setUp()
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"require": {
|
||||
"sunra/dbug": "dev-master"
|
||||
"sunra/dbug": "dev-master",
|
||||
"sensiolabs/ansi-to-html": "dev-master"
|
||||
}
|
||||
}
|
||||
|
@ -47,6 +47,7 @@ if( 'POST' === $_SERVER['REQUEST_METHOD'] ) {
|
||||
<option value="JsonEncode" <?php echo selected($action_str, 'JsonEncode'); ?>>json_encode()</option>
|
||||
<option value="DateC" <?php echo selected($action_str, 'DateC'); ?>>date('c', $timestamp)</option>
|
||||
<option value="ParseStr" <?php echo selected($action_str, 'ParseStr'); ?>>parse_str()</option>
|
||||
<option value="Ansi2Html" <?php echo selected($action_str, 'Ansi2HTml'); ?>>ansi-to-html</option>
|
||||
<select>
|
||||
<input type="submit">
|
||||
</form>
|
||||
|
Loading…
Reference in New Issue
Block a user