Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98794888
PhabricatorRemarkupBlockInterpreterFiglet.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Jan 16, 12:21
Size
885 B
Mime Type
text/x-php
Expires
Sat, Jan 18, 12:21 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23650155
Attached To
rPH Phabricator
PhabricatorRemarkupBlockInterpreterFiglet.php
View Options
<?php
final
class
PhabricatorRemarkupBlockInterpreterFiglet
extends
PhutilRemarkupBlockInterpreter
{
public
function
getInterpreterName
()
{
return
'figlet'
;
}
public
function
markupContent
(
$content
,
array
$argv
)
{
if
(!
Filesystem
::
binaryExists
(
'figlet'
))
{
return
$this
->
markupError
(
pht
(
'Unable to locate the `figlet` binary. Install figlet.'
));
}
$future
=
id
(
new
ExecFuture
(
'figlet'
))
->
setTimeout
(
15
)
->
write
(
trim
(
$content
,
"
\n
"
));
list
(
$err
,
$stdout
,
$stderr
)
=
$future
->
resolve
();
if
(
$err
)
{
return
$this
->
markupError
(
pht
(
'Execution of `figlet` failed:'
,
$stderr
));
}
if
(
$this
->
getEngine
()->
isTextMode
())
{
return
$stdout
;
}
return
phutil_tag
(
'div'
,
array
(
'class'
=>
'PhabricatorMonospaced remarkup-figlet'
,
),
$stdout
);
}
}
Event Timeline
Log In to Comment